Skip to content

Commit

Permalink
Removing after:spec logic not necessary until Cypress 13 migration.
Browse files Browse the repository at this point in the history
  • Loading branch information
1Copenut committed Oct 12, 2023
1 parent 66526b8 commit 4edbee5
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,6 @@ export default defineConfig({
},
});

on('after:spec', (spec, results) => {
// See https://docs.cypress.io/guides/guides/screenshots-and-videos#Delete-videos-for-specs-without-failing-or-retried-tests
if (results && results.video) {
// Search the returned Results object for failed attempts
// See https://docs.cypress.io/guides/guides/module-api#Results
const failures = results.tests.some((test) => {
test.attempts.some((attempt) => {
attempt.state === 'failed';
});
});

if (!failures) {
// Delete the video if there are no failed attempts
fs.unlinkSync(results.video);
}
}
});

return config;
},
specPattern: ['./src/**/*.spec.tsx', './src/**/*.a11y.tsx'], // scripts/cypress.js splits this using the CLI --spec argument
Expand Down

0 comments on commit 4edbee5

Please sign in to comment.