@@ -18,13 +18,17 @@ const {
1818 getManifestInputFiles,
1919} = require ( '../../../../ci/test-optimization-validation/runner-command' )
2020const { getRunnerContract } = require ( '../../../../ci/test-optimization-validation/runner-contract' )
21+ const { DD_MAJOR } = require ( '../../../../version' )
2122const {
2223 FRAMEWORKS ,
2324 createRepositoryFixture,
2425 removeFixture,
2526 withRepositoryFixture,
2627} = require ( './validation-test-helpers' )
2728
29+ const CYPRESS_UNSUPPORTED_VERSION = DD_MAJOR >= 6 ? '11.2.0' : '6.6.0'
30+ const CYPRESS_MINIMUM_VERSION = DD_MAJOR >= 6 ? '12.0.0' : '6.7.0'
31+
2832function scaffoldFramework ( fixture , framework ) {
2933 return createManifestScaffold ( { root : fixture . root , frameworks : new Set ( [ framework ] ) } ) . frameworks [ 0 ]
3034}
@@ -2085,16 +2089,16 @@ describe('test optimization validation manifest scaffold', () => {
20852089 const installedPackageJsonPath = path . join ( fixture . root , 'node_modules' , 'cypress' , 'package.json' )
20862090 for ( const filename of [ packageJsonPath , installedPackageJsonPath ] ) {
20872091 const packageJson = JSON . parse ( fs . readFileSync ( filename ) )
2088- packageJson . version = filename === installedPackageJsonPath ? '11.2.0' : packageJson . version
2089- if ( filename === packageJsonPath ) packageJson . devDependencies . cypress = '11.2.0'
2092+ packageJson . version = filename === installedPackageJsonPath ? CYPRESS_UNSUPPORTED_VERSION : packageJson . version
2093+ if ( filename === packageJsonPath ) packageJson . devDependencies . cypress = CYPRESS_UNSUPPORTED_VERSION
20902094 fs . writeFileSync ( filename , `${ JSON . stringify ( packageJson ) } \n` )
20912095 }
20922096 const framework = scaffoldFramework ( fixture , 'cypress' )
20932097
20942098 assert . strictEqual ( framework . status , 'detected_not_runnable' )
20952099 assert . strictEqual ( framework . blockerCategory , 'UNSUPPORTED_VERSION' )
2096- assert . match ( framework . notes [ 0 ] , / C y p r e s s 1 1 \. 2 \. 0 w a s d e t e c t e d / )
2097- assert . match ( framework . notes [ 0 ] , / l i v e v a l i d a t i o n r e q u i r e s > = 1 2 \. 0 \. 0 / )
2100+ assert . ok ( framework . notes [ 0 ] . includes ( ` Cypress ${ CYPRESS_UNSUPPORTED_VERSION } was detected` ) )
2101+ assert . ok ( framework . notes [ 0 ] . includes ( ` live validation requires >=${ CYPRESS_MINIMUM_VERSION } ` ) )
20982102 assert . match ( framework . notes [ 0 ] , / n o r m a l d e p e n d e n c y w o r k f l o w / )
20992103 } )
21002104 } )
0 commit comments