@@ -29,34 +29,39 @@ describe('Article', () => {
29
29
}
30
30
31
31
// Run incremental validation analysis with source file paths
32
- cy . task ( 'runIncrementalValidation' , sourceFilePaths ) . then ( ( results ) => {
33
- validationStrategy = results . validationStrategy ;
34
-
35
- // Save cache statistics and validation strategy for reporting
36
- cy . task ( 'saveCacheStatistics' , results . cacheStats ) ;
37
- cy . task ( 'saveValidationStrategy' , validationStrategy ) ;
38
-
39
- // Update subjects to only test files that need validation
40
- if ( results . filesToValidate . length > 0 ) {
41
- // Convert file paths to URLs using shared utility via Cypress task
42
- const urlPromises = results . filesToValidate . map ( ( file ) =>
43
- cy . task ( 'filePathToUrl' , file . filePath )
44
- ) ;
32
+ cy . task ( 'runIncrementalValidation' , sourceFilePaths )
33
+ . then ( ( results ) => {
34
+ validationStrategy = results . validationStrategy ;
35
+
36
+ // Save cache statistics and validation strategy for reporting
37
+ cy . task ( 'saveCacheStatistics' , results . cacheStats ) ;
38
+ cy . task ( 'saveValidationStrategy' , validationStrategy ) ;
39
+
40
+ // Update subjects to only test files that need validation
41
+ if ( results . filesToValidate . length > 0 ) {
42
+ // Convert file paths to URLs using shared utility via Cypress task
43
+ const urlPromises = results . filesToValidate . map ( ( file ) =>
44
+ cy . task ( 'filePathToUrl' , file . filePath )
45
+ ) ;
45
46
46
- cy . wrap ( Promise . all ( urlPromises ) ) . then ( ( urls ) => {
47
- subjects = urls ;
47
+ cy . wrap ( Promise . all ( urlPromises ) ) . then ( ( urls ) => {
48
+ subjects = urls ;
48
49
49
- cy . log ( `📊 Cache Analysis: ${ results . cacheStats . hitRate } % hit rate` ) ;
50
- cy . log (
51
- `🔄 Testing ${ subjects . length } pages (${ results . cacheStats . cacheHits } cached)`
52
- ) ;
53
- } ) ;
54
- } else {
55
- // All files are cached, no validation needed
56
- subjects = [ ] ;
57
- cy . log ( '✨ All files cached - skipping validation' ) ;
58
- }
59
- } ) ;
50
+ cy . log ( `📊 Cache Analysis: ${ results . cacheStats . hitRate } % hit rate` ) ;
51
+ cy . log (
52
+ `🔄 Testing ${ subjects . length } pages (${ results . cacheStats . cacheHits } cached)`
53
+ ) ;
54
+ } ) ;
55
+ } else {
56
+ // All files are cached, no validation needed
57
+ subjects = [ ] ;
58
+ cy . log ( '✨ All files cached - skipping validation' ) ;
59
+ }
60
+ } )
61
+ . catch ( ( error ) => {
62
+ cy . log ( '❌ Error during incremental validation task: ' + error . message ) ;
63
+ Cypress . fail ( 'Incremental validation task failed. See logs for details.' ) ;
64
+ } ) ;
60
65
} ) ;
61
66
62
67
// Helper function to identify download links
0 commit comments