Skip to content

Commit dbd293e

Browse files
committed
Migrate to Cypress 10
Ran `cypress open` and walked through migration guide. It generated cypress.config.ts which I renamed to cypress.config.js and reverted to `require()` instead of `import` because of stupid TypeScript typings warnings related to the plugins, which seem perfectly fine. e2e tests all run and pass as before. Unfortunately, coverage is broken because we also need `@cypress/[email protected]` which supports Cypress 10, but it has an issue with this error: cypress-io/code-coverage#573
1 parent 1a897b1 commit dbd293e

File tree

5 files changed

+67
-162
lines changed

5 files changed

+67
-162
lines changed

cypress.config.js

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
const { defineConfig } = require('cypress');
2+
const setupPlugins = require('./cypress/plugins/index.js');
3+
4+
module.exports = defineConfig({
5+
viewportHeight: 600,
6+
viewportWidth: 800,
7+
video: false,
8+
e2e: {
9+
// We've imported your old cypress plugins here.
10+
// You may want to clean this up later by importing these.
11+
setupNodeEvents(on, config) {
12+
return setupPlugins(on, config); // DEBUG require('./cypress/plugins/index.js')(on, config)
13+
},
14+
specPattern: 'test/e2e/**/*.e2e.js',
15+
},
16+
});

cypress.json

-8
This file was deleted.
File renamed without changes.

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
"test:types": "tsc index.d.ts",
3333
"test:unit": "jest",
3434
"test:e2e": "ELECTRON_ENABLE_LOGGING=1 cypress run",
35-
"test:e2e:dev": "cypress open",
36-
"test:coverage": "cypress run --env coverage=true",
35+
"test:e2e:dev": "cypress open --browser --e2e",
36+
"test:coverage": "yarn test:e2e --env coverage=true",
3737
"prepare": "yarn build",
3838
"prepublishOnly": "yarn test && yarn build",
3939
"release": "yarn build && changeset publish"
@@ -58,7 +58,7 @@
5858
"@babel/plugin-proposal-optional-chaining": "^7.16.0",
5959
"@babel/preset-env": "^7.18.2",
6060
"@changesets/cli": "^2.23.0",
61-
"@cypress/code-coverage": "^3.9.12",
61+
"@cypress/code-coverage": "^3.10.0",
6262
"@rollup/plugin-babel": "^5.3.1",
6363
"@rollup/plugin-commonjs": "^22.0.0",
6464
"@rollup/plugin-node-resolve": "^13.3.0",

0 commit comments

Comments
 (0)