@@ -11,6 +11,8 @@ const config = require(`../../lib/config`)
11
11
const errors = require ( `../../lib/errors` )
12
12
const configUtil = require ( `../../lib/util/config` )
13
13
14
+ const os = require ( 'node:os' )
15
+
14
16
describe ( 'lib/config' , ( ) => {
15
17
before ( function ( ) {
16
18
this . env = process . env
@@ -157,18 +159,10 @@ describe('lib/config', () => {
157
159
return this . expectValidationPasses ( )
158
160
} )
159
161
160
- // NOTE: Validated in real use
161
- it . skip ( 'validates cypress.config.js' , function ( ) {
162
+ it ( 'validates cypress.config.js' , function ( ) {
162
163
this . setup ( { reporter : 5 } )
163
164
164
- return this . expectValidationFails ( 'cypress.config.{js,ts,mjs,cjs}' )
165
- } )
166
-
167
- // NOTE: Validated in real use
168
- it . skip ( 'validates cypress.env.json' , function ( ) {
169
- this . setup ( { } , { reporter : 5 } )
170
-
171
- return this . expectValidationFails ( 'cypress.env.json' )
165
+ return this . expectValidationFails ( 'Expected reporter to be a string' )
172
166
} )
173
167
174
168
it ( 'only validates known values' , function ( ) {
@@ -577,28 +571,27 @@ describe('lib/config', () => {
577
571
} )
578
572
} )
579
573
580
- // TODO:(lachlan): after mega PR
581
- context . skip ( 'specPattern' , ( ) => {
574
+ context ( 'specPattern' , ( ) => {
582
575
it ( 'passes if a string' , function ( ) {
583
- this . setup ( { e2e : { specPattern : '**/*.coffee' } } )
576
+ this . setup ( { e2e : { supportFile : false , specPattern : '**/*.coffee' } } )
584
577
585
578
return this . expectValidationPasses ( )
586
579
} )
587
580
588
581
it ( 'passes if an array of strings' , function ( ) {
589
- this . setup ( { e2e : { specPattern : [ '**/*.coffee' ] } } )
582
+ this . setup ( { e2e : { supportFile : false , specPattern : [ '**/*.coffee' ] } } )
590
583
591
584
return this . expectValidationPasses ( )
592
585
} )
593
586
594
587
it ( 'fails if not a string or array' , function ( ) {
595
- this . setup ( { e2e : { specPattern : 42 } } )
588
+ this . setup ( { e2e : { supportFile : false , specPattern : 42 } } )
596
589
597
590
return this . expectValidationFails ( 'be a string or an array of strings' )
598
591
} )
599
592
600
593
it ( 'fails if not an array of strings' , function ( ) {
601
- this . setup ( { e2e : { specPattern : [ 5 ] } } )
594
+ this . setup ( { e2e : { supportFile : false , specPattern : [ 5 ] } } )
602
595
603
596
return this . expectValidationFails ( 'be a string or an array of strings' )
604
597
. then ( ( ) => {
@@ -1466,8 +1459,7 @@ describe('lib/config', () => {
1466
1459
expect ( warning ) . to . be . calledWith ( 'FIREFOX_GC_INTERVAL_REMOVED' )
1467
1460
} )
1468
1461
1469
- // TODO:(lachlan) after mega PR
1470
- describe . skip ( '.resolved' , ( ) => {
1462
+ describe ( '.resolved' , ( ) => {
1471
1463
it ( 'sets reporter and port to cli' , ( ) => {
1472
1464
const obj = {
1473
1465
projectRoot : '/foo/bar' ,
@@ -1483,22 +1475,20 @@ describe('lib/config', () => {
1483
1475
. then ( ( cfg ) => {
1484
1476
expect ( cfg . resolved ) . to . deep . eq ( {
1485
1477
animationDistanceThreshold : { value : 5 , from : 'default' } ,
1478
+ arch : { value : os . arch ( ) , from : 'default' } ,
1486
1479
baseUrl : { value : null , from : 'default' } ,
1487
1480
blockHosts : { value : null , from : 'default' } ,
1488
1481
browsers : { value : [ ] , from : 'default' } ,
1489
1482
chromeWebSecurity : { value : true , from : 'default' } ,
1490
1483
clientCertificates : { value : [ ] , from : 'default' } ,
1491
- component : { from : 'default' , value : { } } ,
1492
1484
defaultCommandTimeout : { value : 4000 , from : 'default' } ,
1493
1485
downloadsFolder : { value : 'cypress/downloads' , from : 'default' } ,
1494
- e2e : { from : 'default' , value : { } } ,
1495
1486
env : { } ,
1496
1487
execTimeout : { value : 60000 , from : 'default' } ,
1497
1488
experimentalFetchPolyfill : { value : false , from : 'default' } ,
1498
1489
experimentalInteractiveRunEvents : { value : false , from : 'default' } ,
1499
1490
experimentalSessionAndOrigin : { value : false , from : 'default' } ,
1500
1491
experimentalSourceRewriting : { value : false , from : 'default' } ,
1501
- experimentalStudio : { value : false , from : 'default' } ,
1502
1492
fileServerFolder : { value : '' , from : 'default' } ,
1503
1493
fixturesFolder : { value : 'cypress/fixtures' , from : 'default' } ,
1504
1494
hosts : { value : null , from : 'default' } ,
@@ -1509,6 +1499,7 @@ describe('lib/config', () => {
1509
1499
modifyObstructiveCode : { value : true , from : 'default' } ,
1510
1500
numTestsKeptInMemory : { value : 50 , from : 'default' } ,
1511
1501
pageLoadTimeout : { value : 60000 , from : 'default' } ,
1502
+ platform : { value : os . platform ( ) , from : 'default' } ,
1512
1503
port : { value : 1234 , from : 'cli' } ,
1513
1504
projectId : { value : null , from : 'default' } ,
1514
1505
redirectionLimit : { value : 20 , from : 'default' } ,
@@ -1525,7 +1516,6 @@ describe('lib/config', () => {
1525
1516
supportFile : { value : false , from : 'config' } ,
1526
1517
supportFolder : { value : false , from : 'default' } ,
1527
1518
taskTimeout : { value : 60000 , from : 'default' } ,
1528
- specPattern : { value : '**/*.*' , from : 'default' } ,
1529
1519
trashAssetsBeforeRuns : { value : true , from : 'default' } ,
1530
1520
userAgent : { value : null , from : 'default' } ,
1531
1521
video : { value : true , from : 'default' } ,
@@ -1570,22 +1560,20 @@ describe('lib/config', () => {
1570
1560
return config . mergeDefaults ( obj , options )
1571
1561
. then ( ( cfg ) => {
1572
1562
expect ( cfg . resolved ) . to . deep . eq ( {
1563
+ arch : { value : os . arch ( ) , from : 'default' } ,
1573
1564
animationDistanceThreshold : { value : 5 , from : 'default' } ,
1574
1565
baseUrl : { value : 'http://localhost:8080' , from : 'config' } ,
1575
1566
blockHosts : { value : null , from : 'default' } ,
1576
1567
browsers : { value : [ ] , from : 'default' } ,
1577
1568
chromeWebSecurity : { value : true , from : 'default' } ,
1578
- component : { from : 'default' , value : { } } ,
1579
1569
clientCertificates : { value : [ ] , from : 'default' } ,
1580
1570
defaultCommandTimeout : { value : 4000 , from : 'default' } ,
1581
1571
downloadsFolder : { value : 'cypress/downloads' , from : 'default' } ,
1582
- e2e : { from : 'default' , value : { } } ,
1583
1572
execTimeout : { value : 60000 , from : 'default' } ,
1584
1573
experimentalFetchPolyfill : { value : false , from : 'default' } ,
1585
1574
experimentalInteractiveRunEvents : { value : false , from : 'default' } ,
1586
1575
experimentalSessionAndOrigin : { value : false , from : 'default' } ,
1587
1576
experimentalSourceRewriting : { value : false , from : 'default' } ,
1588
- experimentalStudio : { value : false , from : 'default' } ,
1589
1577
env : {
1590
1578
foo : {
1591
1579
value : 'foo' ,
@@ -1618,6 +1606,7 @@ describe('lib/config', () => {
1618
1606
modifyObstructiveCode : { value : true , from : 'default' } ,
1619
1607
numTestsKeptInMemory : { value : 50 , from : 'default' } ,
1620
1608
pageLoadTimeout : { value : 60000 , from : 'default' } ,
1609
+ platform : { value : os . platform ( ) , from : 'default' } ,
1621
1610
port : { value : 2020 , from : 'config' } ,
1622
1611
projectId : { value : 'projectId123' , from : 'env' } ,
1623
1612
redirectionLimit : { value : 20 , from : 'default' } ,
@@ -1634,7 +1623,6 @@ describe('lib/config', () => {
1634
1623
supportFile : { value : false , from : 'config' } ,
1635
1624
supportFolder : { value : false , from : 'default' } ,
1636
1625
taskTimeout : { value : 60000 , from : 'default' } ,
1637
- specPattern : { value : '**/*.*' , from : 'default' } ,
1638
1626
trashAssetsBeforeRuns : { value : true , from : 'default' } ,
1639
1627
userAgent : { value : null , from : 'default' } ,
1640
1628
video : { value : true , from : 'default' } ,
@@ -1861,9 +1849,7 @@ describe('lib/config', () => {
1861
1849
} )
1862
1850
} )
1863
1851
1864
- // TODO: Figure out the behavior on updateWithPluginValues, should we check
1865
- // the config from cfg, or get it from the data-context?
1866
- it . skip ( 'catches browsers=null returned from plugins' , ( ) => {
1852
+ it ( 'catches browsers=null returned from plugins' , ( ) => {
1867
1853
const browser = {
1868
1854
name : 'fake browser name' ,
1869
1855
family : 'chromium' ,
0 commit comments