Skip to content

Commit a087906

Browse files
jstirnamanCopilot
andcommitted
Apply suggestions from code review
Co-authored-by: Copilot <[email protected]>
1 parent 0fc2efc commit a087906

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

cypress.config.js

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -205,42 +205,44 @@ export default defineConfig({
205205
return new Promise(async (resolve, reject) => {
206206
try {
207207
console.log('Loading incremental validator module...');
208-
208+
209209
// Use CommonJS require for better compatibility
210-
const { IncrementalValidator } = require('./.github/scripts/incremental-validator.cjs');
210+
const {
211+
IncrementalValidator,
212+
} = require('./.github/scripts/incremental-validator.cjs');
211213
console.log('✅ Incremental validator loaded successfully');
212-
214+
213215
const validator = new IncrementalValidator();
214216
const results = await validator.validateFiles(filePaths);
215217
resolve(results);
216218
} catch (error) {
217219
console.error(`Incremental validation error: ${error.message}`);
218220
console.error(`Stack: ${error.stack}`);
219-
221+
220222
// Don't fail the entire test run due to cache issues
221223
// Fall back to validating all files
222224
console.warn('Falling back to validate all files without cache');
223225
resolve({
224226
validationStrategy: {
225227
unchanged: [],
226-
changed: filePaths.map(filePath => ({
228+
changed: filePaths.map((filePath) => ({
227229
filePath,
228230
fileHash: 'unknown',
229-
links: []
231+
links: [],
230232
})),
231233
newLinks: [],
232-
total: filePaths.length
234+
total: filePaths.length,
233235
},
234-
filesToValidate: filePaths.map(filePath => ({
236+
filesToValidate: filePaths.map((filePath) => ({
235237
filePath,
236-
fileHash: 'unknown'
238+
fileHash: 'unknown',
237239
})),
238240
cacheStats: {
239241
totalFiles: filePaths.length,
240242
cacheHits: 0,
241243
cacheMisses: filePaths.length,
242-
hitRate: 0
243-
}
244+
hitRate: 0,
245+
},
244246
});
245247
}
246248
});
@@ -249,7 +251,9 @@ export default defineConfig({
249251
cacheValidationResults(filePath, fileHash, results) {
250252
return new Promise(async (resolve, reject) => {
251253
try {
252-
const { IncrementalValidator } = require('./.github/scripts/incremental-validator.cjs');
254+
const {
255+
IncrementalValidator,
256+
} = require('./.github/scripts/incremental-validator.cjs');
253257
const validator = new IncrementalValidator();
254258
const success = await validator.cacheResults(
255259
filePath,
@@ -275,7 +279,9 @@ export default defineConfig({
275279
} catch (error) {
276280
console.error(`URL transformation error: ${error.message}`);
277281
// Fallback: return the file path as-is if transformation fails
278-
console.warn(`Using fallback URL transformation for: ${filePath}`);
282+
console.warn(
283+
`Using fallback URL transformation for: ${filePath}`
284+
);
279285
resolve(filePath);
280286
}
281287
});

0 commit comments

Comments
 (0)