@@ -142,8 +142,8 @@ describe('tests platform/spec restore with --save', function () {
142
142
var cwd = process . cwd ( ) ;
143
143
var pkgJsonPath = path . join ( cwd , 'package.json' ) ;
144
144
var pkgJson ;
145
- var platformsFolderPath = path . join ( cwd , 'platforms/platforms.json' ) ;
146
- var platformsJson ;
145
+ // var platformsFolderPath = path.join(cwd, 'platforms/platforms.json');
146
+ // var platformsJson;
147
147
var configXmlPath = path . join ( cwd , 'config.xml' ) ;
148
148
var bPlatform = 'browser' ;
149
149
var engines ;
@@ -170,8 +170,8 @@ describe('tests platform/spec restore with --save', function () {
170
170
expect ( pkgJson . cordova . platforms . indexOf ( 'browser' ) ) . toBeDefined ( ) ;
171
171
expect ( pkgJson . dependencies [ 'cordova-browser' ] ) . toEqual ( 'git+https://github.com/apache/cordova-browser.git' ) ;
172
172
// Check that platform was added to platforms list successfully.
173
- platformsJson = cordova_util . requireNoCache ( platformsFolderPath ) ;
174
- expect ( platformsJson [ bPlatform ] ) . toBeDefined ( ) ;
173
+ // platformsJson = cordova_util.requireNoCache(platformsFolderPath);
174
+ // expect(platformsJson[bPlatform]).toBeDefined();
175
175
} ) . then ( function ( ) {
176
176
// Remove platform without --save.
177
177
return cordovaPlatform ( 'rm' , bPlatform , { 'fetch' : true } ) ;
@@ -181,8 +181,8 @@ describe('tests platform/spec restore with --save', function () {
181
181
expect ( pkgJson . cordova . platforms . indexOf ( 'browser' ) ) . toBeDefined ( ) ;
182
182
expect ( pkgJson . dependencies [ 'cordova-browser' ] ) . toEqual ( 'git+https://github.com/apache/cordova-browser.git' ) ;
183
183
// Platform in platforms.json should not be there.
184
- platformsJson = cordova_util . requireNoCache ( platformsFolderPath ) ;
185
- expect ( platformsJson [ bPlatform ] ) . toBeUndefined ( ) ;
184
+ // platformsJson = cordova_util.requireNoCache(platformsFolderPath);
185
+ // expect(platformsJson[bPlatform]).toBeUndefined();
186
186
} ) . then ( function ( ) {
187
187
// Run cordova prepare
188
188
return prepare ( { 'fetch' : true } ) ;
@@ -203,8 +203,8 @@ describe('tests platform/spec restore with --save', function () {
203
203
expect ( pkgJson . cordova . platforms . indexOf ( 'browser' ) ) . toBeDefined ( ) ;
204
204
expect ( pkgJson . dependencies [ 'cordova-browser' ] ) . toEqual ( 'git+https://github.com/apache/cordova-browser.git' ) ;
205
205
// Check that platform was restored to platform.json list successfully.
206
- platformsJson = cordova_util . requireNoCache ( platformsFolderPath ) ;
207
- expect ( platformsJson [ bPlatform ] ) . toBeDefined ( ) ;
206
+ // platformsJson = cordova_util.requireNoCache(platformsFolderPath);
207
+ // expect(platformsJson[bPlatform]).toBeDefined();
208
208
} ) . fail ( function ( err ) {
209
209
expect ( err ) . toBeUndefined ( ) ;
210
210
} ) . fin ( done ) ;
@@ -330,9 +330,9 @@ describe('tests platform/spec restore with --save', function () {
330
330
var cwd = process . cwd ( ) ;
331
331
var pkgJsonPath = path . join ( cwd , 'package.json' ) ;
332
332
var pkgJson ;
333
- var platformsFolderPath = path . join ( cwd , 'platforms/platforms.json' ) ;
333
+ // var platformsFolderPath = path.join(cwd, 'platforms/platforms.json');
334
334
var secondPlatformAdded = 'browser' ;
335
- var platformsJson ;
335
+ // var platformsJson;
336
336
337
337
emptyPlatformList ( ) . then ( function ( ) {
338
338
// Add 'browser' platform to project without --save
@@ -343,14 +343,14 @@ describe('tests platform/spec restore with --save', function () {
343
343
} ) . then ( function ( ) {
344
344
// Delete any previous caches of require(package.json) and (platformsJson)
345
345
pkgJson = cordova_util . requireNoCache ( pkgJsonPath ) ;
346
- platformsJson = cordova_util . requireNoCache ( platformsFolderPath ) ;
346
+ // platformsJson = cordova_util.requireNoCache(platformsFolderPath);
347
347
// Check the platform add of only helpers.testPlatform was successful in package.json.
348
348
expect ( pkgJson . cordova . platforms ) . toBeDefined ( ) ;
349
349
expect ( pkgJson . cordova . platforms . indexOf ( helpers . testPlatform ) ) . toBeGreaterThan ( - 1 ) ;
350
350
expect ( pkgJson . cordova . platforms . indexOf ( secondPlatformAdded ) ) . toEqual ( - 1 ) ;
351
351
// Expect both platforms to be installed platform list in platforms.json
352
- expect ( platformsJson [ helpers . testPlatform ] ) . toBeDefined ( ) ;
353
- expect ( platformsJson [ secondPlatformAdded ] ) . toBeDefined ( ) ;
352
+ // expect(platformsJson[helpers.testPlatform]).toBeDefined();
353
+ // expect(platformsJson[secondPlatformAdded]).toBeDefined();
354
354
} ) . then ( fullPlatformList ) // Platforms should still be in platform ls.
355
355
. then ( function ( ) {
356
356
// Remove helpers.testPlatform without --save.
@@ -360,23 +360,23 @@ describe('tests platform/spec restore with --save', function () {
360
360
return cordovaPlatform ( 'rm' , secondPlatformAdded ) ;
361
361
} ) . then ( function ( ) {
362
362
// Delete any previous caches of require(pkgJson) and (platformsJson)
363
- platformsJson = cordova_util . requireNoCache ( platformsFolderPath ) ;
363
+ // platformsJson = cordova_util.requireNoCache(platformsFolderPath);
364
364
pkgJson = cordova_util . requireNoCache ( pkgJsonPath ) ;
365
365
// Check that the platform that was added with --save is still in package.json.
366
366
expect ( pkgJson . cordova . platforms . indexOf ( helpers . testPlatform ) ) . toBeGreaterThan ( - 1 ) ;
367
367
// Check that both platforms were removed from the platforms.json.
368
- expect ( platformsJson [ secondPlatformAdded ] ) . toBeUndefined ( ) ;
369
- expect ( platformsJson [ helpers . testPlatform ] ) . toBeUndefined ( ) ;
368
+ // expect(platformsJson[secondPlatformAdded]).toBeUndefined();
369
+ // expect(platformsJson[helpers.testPlatform]).toBeUndefined();
370
370
} ) . then ( function ( ) {
371
371
// Run cordova prepare
372
372
return prepare ( ) ;
373
373
} ) . then ( function ( ) {
374
374
// Delete any previous caches of platformsJson
375
- platformsJson = cordova_util . requireNoCache ( platformsFolderPath ) ;
375
+ // platformsJson = cordova_util.requireNoCache(platformsFolderPath);
376
376
// Expect "helpers.testPlatform" to be in the installed platforms list.
377
- expect ( platformsJson [ helpers . testPlatform ] ) . toBeDefined ( ) ;
377
+ // expect(platformsJson[helpers.testPlatform]).toBeDefined();
378
378
// Expect that 'browser' will not be in platforms.json and has not been restored.
379
- expect ( platformsJson [ secondPlatformAdded ] ) . toBeUndefined ( ) ;
379
+ // expect(platformsJson[secondPlatformAdded]).toBeUndefined();
380
380
} ) . fail ( function ( err ) {
381
381
expect ( err ) . toBeUndefined ( ) ;
382
382
} ) . fin ( done ) ;
@@ -1281,9 +1281,9 @@ describe('platforms and plugins should be restored with config.xml even without
1281
1281
} ) ;
1282
1282
var configEngArray = engNames . slice ( ) ;
1283
1283
var configPlugins = cfg1 . getPluginIdList ( ) ;
1284
- var platformsFolderPath1 = path . join ( cwd , 'platforms/platforms.json' ) ;
1284
+ // var platformsFolderPath1 = path.join(cwd, 'platforms/platforms.json');
1285
1285
var pluginsFolderPath16 = path . join ( cwd , 'plugins' ) ;
1286
- var platformsJson ;
1286
+ // var platformsJson;
1287
1287
var androidPlatform = 'android' ;
1288
1288
var browserPlatform = 'browser' ;
1289
1289
@@ -1307,11 +1307,11 @@ describe('platforms and plugins should be restored with config.xml even without
1307
1307
configEngArray = engNames . slice ( ) ;
1308
1308
expect ( configEngArray . length === 2 ) ;
1309
1309
// Delete previouc caches of (pkg.json).
1310
- platformsJson = cordova_util . requireNoCache ( platformsFolderPath1 ) ;
1310
+ // platformsJson = cordova_util.requireNoCache(platformsFolderPath1);
1311
1311
// Browser should be installed
1312
- expect ( platformsJson ) . toBeDefined ( ) ;
1313
- expect ( platformsJson [ androidPlatform ] ) . not . toBeDefined ( ) ;
1314
- expect ( platformsJson [ browserPlatform ] ) . toBeDefined ( ) ;
1312
+ // expect(platformsJson).toBeDefined();
1313
+ // expect(platformsJson[androidPlatform]).not.toBeDefined();
1314
+ // expect(platformsJson[browserPlatform]).toBeDefined();
1315
1315
// Package.json should be auto-created.
1316
1316
expect ( path . join ( cwd , 'package.json' ) ) . toExist ( ) ;
1317
1317
var pkgJsonPath = path . join ( cwd , 'package.json' ) ;
@@ -1326,10 +1326,10 @@ describe('platforms and plugins should be restored with config.xml even without
1326
1326
return cordovaPlatform ( 'rm' , [ browserPlatform ] ) ;
1327
1327
} ) . then ( function ( ) {
1328
1328
// Android should not be in the installed list (only browser).
1329
- platformsJson = cordova_util . requireNoCache ( platformsFolderPath1 ) ;
1330
- expect ( platformsJson ) . toBeDefined ( ) ;
1331
- expect ( platformsJson [ browserPlatform ] ) . toBeUndefined ( ) ;
1332
- expect ( platformsJson [ androidPlatform ] ) . not . toBeDefined ( ) ;
1329
+ // platformsJson = cordova_util.requireNoCache(platformsFolderPath1);
1330
+ // expect(platformsJson).toBeDefined();
1331
+ // expect(platformsJson[browserPlatform]).toBeUndefined();
1332
+ // expect(platformsJson[androidPlatform]).not.toBeDefined();
1333
1333
} ) . then ( function ( ) {
1334
1334
// Run cordova prepare.
1335
1335
return prepare ( ) ;
@@ -1345,9 +1345,9 @@ describe('platforms and plugins should be restored with config.xml even without
1345
1345
expect ( configEngArray . indexOf ( browserPlatform ) ) . toBeGreaterThan ( - 1 ) ;
1346
1346
expect ( configEngArray . length === 2 ) ;
1347
1347
// Expect that android and browser were restored.
1348
- platformsJson = cordova_util . requireNoCache ( platformsFolderPath1 ) ;
1349
- expect ( platformsJson [ androidPlatform ] ) . toBeDefined ( ) ;
1350
- expect ( platformsJson [ browserPlatform ] ) . toBeDefined ( ) ;
1348
+ // platformsJson = cordova_util.requireNoCache(platformsFolderPath1);
1349
+ // expect(platformsJson[androidPlatform]).toBeDefined();
1350
+ // expect(platformsJson[browserPlatform]).toBeDefined();
1351
1351
} ) . then ( function ( ) {
1352
1352
// Check plugins.
1353
1353
var cfg5 = new ConfigParser ( configXmlPath ) ;
@@ -1438,42 +1438,42 @@ describe('tests platform/spec restore with --save', function () {
1438
1438
var pkgJsonPath = path . join ( cwd , 'package.json' ) ;
1439
1439
cordova_util . requireNoCache ( pkgJsonPath ) ;
1440
1440
var pkgJson ;
1441
- var platformsFolderPath = path . join ( cwd , 'platforms/platforms.json' ) ;
1442
- var platformsJson ;
1441
+ // var platformsFolderPath = path.join(cwd, 'platforms/platforms.json');
1442
+ // var platformsJson;
1443
1443
1444
1444
emptyPlatformList ( ) . then ( function ( ) {
1445
1445
// Add the testing platform with --save.
1446
1446
return cordovaPlatform ( 'add' , 'android' , { 'save' : true } ) ;
1447
1447
} ) . then ( function ( ) {
1448
1448
pkgJson = cordova_util . requireNoCache ( pkgJsonPath ) ;
1449
1449
// Require platformsFolderPath
1450
- platformsJson = cordova_util . requireNoCache ( platformsFolderPath ) ;
1450
+ // platformsJson = cordova_util.requireNoCache(platformsFolderPath);
1451
1451
// Check the platform add was successful in package.json.
1452
1452
expect ( pkgJson . cordova . platforms ) . toBeDefined ( ) ;
1453
1453
expect ( pkgJson . cordova . platforms . indexOf ( helpers . testPlatform ) ) . toBeGreaterThan ( - 1 ) ;
1454
1454
// Expect that "helpers.testPlatform" in the installed platform list in platforms.json
1455
- expect ( platformsJson ) . toBeDefined ( ) ;
1456
- expect ( platformsJson [ helpers . testPlatform ] ) . toBeDefined ( ) ;
1455
+ // expect(platformsJson).toBeDefined();
1456
+ // expect(platformsJson[helpers.testPlatform]).toBeDefined();
1457
1457
} ) . then ( fullPlatformList ) // Platform should still be in platform ls.
1458
1458
. then ( function ( ) {
1459
1459
// And now remove helpers.testPlatform without --save.
1460
1460
return cordovaPlatform ( 'rm' , [ helpers . testPlatform ] ) ;
1461
1461
} ) . then ( function ( ) {
1462
1462
// Delete any previous caches of require(package.json) and (platforms.json)
1463
- platformsJson = cordova_util . requireNoCache ( platformsFolderPath ) ;
1463
+ // platformsJson = cordova_util.requireNoCache(platformsFolderPath);
1464
1464
pkgJson = cordova_util . requireNoCache ( pkgJsonPath ) ;
1465
1465
// Check that the platform removed without --save is still in platforms key.
1466
1466
expect ( pkgJson . cordova . platforms . indexOf ( helpers . testPlatform ) ) . toBeGreaterThan ( - 1 ) ;
1467
1467
// Check that the platform was removed from the platforms.json
1468
- expect ( platformsJson [ helpers . testPlatform ] ) . toBeUndefined ( ) ;
1468
+ // expect(platformsJson[helpers.testPlatform]).toBeUndefined();
1469
1469
} ) . then ( function ( ) {
1470
1470
// Run cordova prepare.
1471
1471
return prepare ( ) ;
1472
1472
} ) . then ( function ( ) {
1473
1473
// Delete any previous caches of platforms.json.
1474
- platformsJson = cordova_util . requireNoCache ( platformsFolderPath ) ;
1474
+ // platformsJson = cordova_util.requireNoCache(platformsFolderPath);
1475
1475
// Expect "helpers.testPlatform" to be in the installed platforms list in platforms.json.
1476
- expect ( platformsJson [ helpers . testPlatform ] ) . toBeDefined ( ) ;
1476
+ // expect(platformsJson[helpers.testPlatform]).toBeDefined();
1477
1477
} ) . fail ( function ( err ) {
1478
1478
expect ( err ) . toBeUndefined ( ) ;
1479
1479
} ) . fin ( done ) ;
@@ -1489,8 +1489,8 @@ describe('tests platform/spec restore with --save', function () {
1489
1489
var cwd = process . cwd ( ) ;
1490
1490
var pkgJsonPath = path . join ( cwd , 'package.json' ) ;
1491
1491
var pkgJson ;
1492
- var platformsFolderPath = path . join ( cwd , 'platforms/platforms.json' ) ;
1493
- var platformsJson ;
1492
+ // var platformsFolderPath = path.join(cwd, 'platforms/platforms.json');
1493
+ // var platformsJson;
1494
1494
var secondPlatformAdded = 'browser' ;
1495
1495
1496
1496
emptyPlatformList ( ) . then ( function ( ) {
@@ -1502,15 +1502,15 @@ describe('tests platform/spec restore with --save', function () {
1502
1502
} ) . then ( function ( ) {
1503
1503
// Delete any previous caches of require(package.json) and (platforms.json).
1504
1504
pkgJson = cordova_util . requireNoCache ( pkgJsonPath ) ;
1505
- platformsJson = cordova_util . requireNoCache ( platformsFolderPath ) ;
1505
+ // platformsJson = cordova_util.requireNoCache(platformsFolderPath);
1506
1506
// Check the platform add of both platforms (to pkg.Json) was successful.
1507
1507
expect ( pkgJson . cordova . platforms ) . toBeDefined ( ) ;
1508
1508
expect ( pkgJson . cordova . platforms . indexOf ( helpers . testPlatform ) ) . toEqual ( 0 ) ;
1509
1509
expect ( pkgJson . cordova . platforms . indexOf ( secondPlatformAdded ) ) . toEqual ( 1 ) ;
1510
1510
// Expect that "helpers.testPlatform" in the installed platform list in platforms.json.
1511
- expect ( platformsJson ) . toBeDefined ( ) ;
1512
- expect ( platformsJson [ helpers . testPlatform ] ) . toBeDefined ( ) ;
1513
- expect ( platformsJson [ secondPlatformAdded ] ) . toBeDefined ( ) ;
1511
+ // expect(platformsJson).toBeDefined();
1512
+ // expect(platformsJson[helpers.testPlatform]).toBeDefined();
1513
+ // expect(platformsJson[secondPlatformAdded]).toBeDefined();
1514
1514
} ) . then ( fullPlatformList ) // Platform should still be in platform ls.
1515
1515
. then ( function ( ) {
1516
1516
// Remove helpers.testPlatform with --save.
@@ -1520,24 +1520,24 @@ describe('tests platform/spec restore with --save', function () {
1520
1520
return cordovaPlatform ( 'rm' , secondPlatformAdded ) ;
1521
1521
} ) . then ( function ( ) {
1522
1522
// Delete any previous caches of require(package.json) and (platformsJson).
1523
- platformsJson = cordova_util . requireNoCache ( platformsFolderPath ) ;
1523
+ // platformsJson = cordova_util.requireNoCache(platformsFolderPath);
1524
1524
pkgJson = cordova_util . requireNoCache ( pkgJsonPath ) ;
1525
1525
// Check that ONLY the platform removed without --save is still in (pkg.json) platforms key.
1526
1526
expect ( pkgJson . cordova . platforms . indexOf ( secondPlatformAdded ) ) . toEqual ( 0 ) ;
1527
1527
expect ( pkgJson . cordova . platforms . indexOf ( helpers . testPlatform ) ) . toEqual ( - 1 ) ;
1528
1528
// Check that both platforms were removed from the platforms.json list.
1529
- expect ( platformsJson [ helpers . testPlatform ] ) . toBeUndefined ( ) ;
1530
- expect ( platformsJson [ secondPlatformAdded ] ) . toBeUndefined ( ) ;
1529
+ // expect(platformsJson[helpers.testPlatform]).toBeUndefined();
1530
+ // expect(platformsJson[secondPlatformAdded]).toBeUndefined();
1531
1531
} ) . then ( function ( ) {
1532
1532
// Run cordova prepare.
1533
1533
return prepare ( ) ;
1534
1534
} ) . then ( function ( ) {
1535
1535
// Delete any previous caches of platformsJson.
1536
- platformsJson = cordova_util . requireNoCache ( platformsFolderPath ) ;
1536
+ // platformsJson = cordova_util.requireNoCache(platformsFolderPath);
1537
1537
// Expect "helpers.testPlatform" to be in the installed platforms list in platforms.json
1538
- expect ( platformsJson [ helpers . testPlatform ] ) . toBeUndefined ( ) ;
1538
+ // expect(platformsJson[helpers.testPlatform]).toBeUndefined();
1539
1539
// Expect 'browser' not to be in platforms.json and has not been restored.
1540
- expect ( platformsJson [ secondPlatformAdded ] ) . toBeDefined ( ) ;
1540
+ // expect(platformsJson[secondPlatformAdded]).toBeDefined();
1541
1541
} ) . fail ( function ( err ) {
1542
1542
expect ( err ) . toBeUndefined ( ) ;
1543
1543
} ) . fin ( done ) ;
0 commit comments