Skip to content

Commit

Permalink
Import cypress plugins
Browse files Browse the repository at this point in the history
As Cypress 10 depricates the use of a native separate plugins file, we need to import it into the config
  • Loading branch information
JacobArrow committed Oct 28, 2024
1 parent 02f998d commit dacb795
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cypress.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// eslint-disable-next-line import/no-extraneous-dependencies
const { defineConfig } = require("cypress");
const plugins = require("./cypress/plugins");

module.exports = defineConfig({
projectId: "4trcdv",
Expand All @@ -14,6 +15,9 @@ module.exports = defineConfig({
supportFile: "cypress/support/index.ts",
specPattern: "./src/@(apps|components)/**/*.test.@(ts|tsx)",
baseUrl: "http://localhost:57021",
testIsolation: false
testIsolation: false,
setupNodeEvents(on, config) {
return plugins(on, config);
}
}
});
3 changes: 3 additions & 0 deletions cypress/plugins/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Cypress no longer natively supports plugins file, but we keep it for better code abstraction
// https://docs.cypress.io/app/references/migration-guide#Plugins-File-Removed

const task = require("@cypress/code-coverage/task");
const browserify = require("@cypress/browserify-preprocessor");

Expand Down

0 comments on commit dacb795

Please sign in to comment.