11/// <reference types="cypress" />
22
33describe ( 'Article' , ( ) => {
4- let subjects = Cypress . env ( 'test_subjects' )
5- ? Cypress . env ( 'test_subjects' ) . split ( ',' ) . filter ( s => s . trim ( ) !== '' )
4+ let subjects = Cypress . env ( 'test_subjects' )
5+ ? Cypress . env ( 'test_subjects' )
6+ . split ( ',' )
7+ . filter ( ( s ) => s . trim ( ) !== '' )
68 : [ ] ;
79 let validationStrategy = null ;
810
@@ -221,7 +223,9 @@ describe('Article', () => {
221223 // In fallback mode, if we have no subjects, that might be expected
222224 if ( subjects . length === 0 ) {
223225 cy . log ( 'ℹ️ No subjects to test in fallback mode' ) ;
224- cy . log ( ' This indicates no test subjects were provided to the runner' ) ;
226+ cy . log (
227+ ' This indicates no test subjects were provided to the runner'
228+ ) ;
225229 } else {
226230 cy . log ( `✅ Testing ${ subjects . length } subjects in fallback mode` ) ;
227231 }
@@ -233,13 +237,19 @@ describe('Article', () => {
233237
234238 // Don't fail if this is expected (cache hit scenario)
235239 const testSubjectsData = Cypress . env ( 'test_subjects_data' ) ;
236- if ( testSubjectsData && testSubjectsData !== '[]' && testSubjectsData !== '' ) {
240+ if (
241+ testSubjectsData &&
242+ testSubjectsData !== '[]' &&
243+ testSubjectsData !== ''
244+ ) {
237245 cy . log ( '✅ Cache optimization active - this is expected' ) ;
238246 cy . log ( 'ℹ️ Test subjects data is available, all files cached' ) ;
239247 } else {
240248 cy . log ( '⚠️ No test subjects data available' ) ;
241249 cy . log ( ' This may indicate no files were provided to test' ) ;
242- cy . log ( ' This is not necessarily an error - may be expected for some runs' ) ;
250+ cy . log (
251+ ' This is not necessarily an error - may be expected for some runs'
252+ ) ;
243253 }
244254 } else {
245255 cy . log ( `✅ Ready to test ${ subjects . length } pages` ) ;
@@ -252,18 +262,24 @@ describe('Article', () => {
252262 // Check for truly problematic scenarios
253263 if ( ! validationStrategy && subjects . length === 0 ) {
254264 const testSubjectsData = Cypress . env ( 'test_subjects_data' ) ;
255- if ( ! testSubjectsData || testSubjectsData === '' || testSubjectsData === '[]' ) {
265+ if (
266+ ! testSubjectsData ||
267+ testSubjectsData === '' ||
268+ testSubjectsData === '[]'
269+ ) {
256270 cy . log ( '❌ Critical setup issue detected:' ) ;
257271 cy . log ( ' • No validation strategy' ) ;
258272 cy . log ( ' • No test subjects' ) ;
259273 cy . log ( ' • No test subjects data' ) ;
260274 cy . log ( ' This indicates a fundamental configuration problem' ) ;
261-
275+
262276 // Only fail in this truly problematic case
263- throw new Error ( 'Critical test setup failure: No strategy, subjects, or data available' ) ;
277+ throw new Error (
278+ 'Critical test setup failure: No strategy, subjects, or data available'
279+ ) ;
264280 }
265281 }
266-
282+
267283 // Always pass if we get to this point - the setup is valid
268284 cy . log ( '✅ Test setup validation completed successfully' ) ;
269285 } ) ;
0 commit comments