From 4edbee563ab1f942334e72c3b323f3edc9264a94 Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Thu, 12 Oct 2023 15:17:41 -0500 Subject: [PATCH] Removing after:spec logic not necessary until Cypress 13 migration. --- cypress.config.ts | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/cypress.config.ts b/cypress.config.ts index 251c48df4ca..8a6b2597784 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -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