Skip to content

Commit b958ed2

Browse files
authored
Upgrade Cypress to v10 (#1649)
1 parent b18f95a commit b958ed2

19 files changed

+97
-1113
lines changed

cypress.config.js

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/* eslint-disable global-require */
2+
const { defineConfig } = require('cypress');
3+
4+
module.exports = defineConfig({
5+
projectId: 'dbquo6',
6+
viewportWidth: 1600,
7+
viewportHeight: 1200,
8+
requestTimeout: 10000,
9+
env: {
10+
RETRIES: 2,
11+
codeCoverage: {
12+
url: '/api/__coverage__',
13+
},
14+
},
15+
retries: {
16+
runMode: 2,
17+
openMode: 2,
18+
},
19+
e2e: {
20+
// We've imported your old cypress plugins here.
21+
// You may want to clean this up later by importing these.
22+
setupNodeEvents(on, config) {
23+
return require('./cypress/plugins/index')(on, config);
24+
},
25+
baseUrl: 'http://localhost:3000',
26+
specPattern: 'cypress/e2e/**/*.{js,jsx,ts,tsx}',
27+
},
28+
});

cypress.json

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

cypress/integration/login.spec.js renamed to cypress/e2e/login.spec.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,9 @@ describe('login', () => {
2727

2828
cy.getCookies().then(([tokenCookie]) => {
2929
const jwt = jwt_decode(tokenCookie.value);
30-
30+
expect(jwt.zipcode).to.exist;
3131
expect(jwt.firstName).to.exist;
3232
expect(jwt.lastName).to.exist;
33-
expect(jwt.zipcode).to.exist;
3433
});
3534
});
3635

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

cypress/plugins/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ module.exports = (on, config) => {
1818
// `config` is the resolved Cypress config
1919
addMatchImageSnapshotPlugin(on, config);
2020
require('@cypress/code-coverage/task')(on, config);
21-
on('file:preprocessor', require('@cypress/code-coverage/use-browserify-istanbul'));
21+
on('file:preprocessor', require('@cypress/code-coverage/use-babelrc'));
2222

2323
// this fixes aliasing in cypres e2e tests
2424
// https://github.com/cypress-io/cypress/issues/3262#issuecomment-462646891
File renamed without changes.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
"devDependencies": {
8080
"@babel/core": "^7.18.9",
8181
"@babel/eslint-parser": "^7.18.9",
82-
"@cypress/code-coverage": "3.9.12",
82+
"@cypress/code-coverage": "^3.10.0",
8383
"@cypress/webpack-preprocessor": "^5.12.0",
8484
"@operation_code/eslint-plugin-custom-rules": "^1.0.1",
8585
"@storybook/addon-actions": "6.5.9",
@@ -107,7 +107,7 @@
107107
"chromatic": "^6.7.3",
108108
"cross-env": "^7.0.3",
109109
"css-loader": "^6.7.1",
110-
"cypress": "^9.5.3",
110+
"cypress": "^10.3.1",
111111
"cypress-image-snapshot": "^4.0.1",
112112
"eslint": "^8.21.0",
113113
"eslint-config-airbnb": "^19.0.4",

yarn.lock

+65-1,091
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)