Skip to content

Commit 8fd72e1

Browse files
committed
Migrate Cypress from ESM to CJS format, upgrade Cypress
Cypress isn't yet 100% compatible with Yarn 3, plug-n-play mode and typescript. The solution is to use good ol' fashioned JS with its config file. See cypress-io/cypress#22747
1 parent d0fa4ef commit 8fd72e1

7 files changed

+40
-44
lines changed

.eslintrc.json

+3-8
Original file line numberDiff line numberDiff line change
@@ -76,19 +76,14 @@
7676
"@typescript-eslint/member-ordering": "off",
7777
"@typescript-eslint/prefer-includes": "off",
7878
"@typescript-eslint/no-restricted-imports": "off",
79-
"@typescript-eslint/no-misused-promises": [
80-
"error",
81-
{
82-
"checksVoidReturn": false
83-
}
84-
],
79+
8580
"import/no-deprecated": "error",
8681
"import/order": "off",
8782
"import/no-extraneous-dependencies": [
8883
"error",
8984
{
9085
"devDependencies": [
91-
"cypress.config.ts",
86+
"cypress.config.js",
9287
"vite.config.ts",
9388
"src/setupTests.ts",
9489
"src/testUtils.tsx",
@@ -175,7 +170,7 @@
175170
}
176171
},
177172
{
178-
"files": ["vite.config.ts", "cypress.config.ts"],
173+
"files": ["vite.config.ts"],
179174
"parserOptions": {
180175
"project": ["./tsconfig.node.json"]
181176
}

.pnp.cjs

+24-24
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cypress.config.ts renamed to cypress.config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { defineConfig } from 'cypress';
1+
const { defineConfig } = require('cypress');
22

3-
export default defineConfig({
3+
module.exports = defineConfig({
44
fileServerFolder: 'dist',
55
fixturesFolder: false,
66
projectId: 'etow1b',

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"autoprefixer": "^10.4.14",
6363
"commitizen": "4.3.0",
6464
"css-mediaquery": "0.1.2",
65-
"cypress": "12.12.0",
65+
"cypress": "12.17.2",
6666
"cz-conventional-changelog": "3.3.0",
6767
"debug": "^4.3.4",
6868
"eslint": "^8.45.0",

tsconfig.node.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"compilerOptions": {
33
"allowSyntheticDefaultImports": true,
4+
"baseUrl": "./.yarn/cache",
45
"composite": true,
56
"forceConsistentCasingInFileNames": true,
67
"isolatedModules": true,
@@ -10,5 +11,5 @@
1011
"strict": true,
1112
"target": "ESNext"
1213
},
13-
"include": ["vite.config.ts", "cypress.config.ts"]
14+
"include": ["vite.config.ts"]
1415
}

yarn.lock

+8-8
Original file line numberDiff line numberDiff line change
@@ -1812,7 +1812,7 @@ __metadata:
18121812
languageName: node
18131813
linkType: hard
18141814

1815-
"@cypress/request@npm:^2.88.10":
1815+
"@cypress/request@npm:^2.88.11":
18161816
version: 2.88.11
18171817
resolution: "@cypress/request@npm:2.88.11"
18181818
dependencies:
@@ -4382,7 +4382,7 @@ __metadata:
43824382
autoprefixer: ^10.4.14
43834383
commitizen: 4.3.0
43844384
css-mediaquery: 0.1.2
4385-
cypress: 12.12.0
4385+
cypress: 12.17.2
43864386
cz-conventional-changelog: 3.3.0
43874387
debug: ^4.3.4
43884388
design-stories: "cfpb/design-stories#0.0.1"
@@ -4993,11 +4993,11 @@ __metadata:
49934993
languageName: node
49944994
linkType: hard
49954995

4996-
"cypress@npm:12.12.0":
4997-
version: 12.12.0
4998-
resolution: "cypress@npm:12.12.0"
4996+
"cypress@npm:12.17.2":
4997+
version: 12.17.2
4998+
resolution: "cypress@npm:12.17.2"
49994999
dependencies:
5000-
"@cypress/request": ^2.88.10
5000+
"@cypress/request": ^2.88.11
50015001
"@cypress/xvfb": ^1.2.4
50025002
"@types/node": ^14.14.31
50035003
"@types/sinonjs__fake-timers": 8.1.1
@@ -5034,14 +5034,14 @@ __metadata:
50345034
pretty-bytes: ^5.6.0
50355035
proxy-from-env: 1.0.0
50365036
request-progress: ^3.0.0
5037-
semver: ^7.3.2
5037+
semver: ^7.5.3
50385038
supports-color: ^8.1.1
50395039
tmp: ~0.2.1
50405040
untildify: ^4.0.0
50415041
yauzl: ^2.10.0
50425042
bin:
50435043
cypress: bin/cypress
5044-
checksum: 5ab0a8bc58c8af90cdb5fea93692422e6e74436ffdaeb41853e91a3fcfcdb7a39ad6ae512537bf0edf25cc3bc3732248a32e8ad3bec3440d5f527f3a3b4650b7
5044+
checksum: 19144db1fe02d92270de71f69ece324affd2f60bafa2f7018440c00907f837b1f8556926206df8b6e7b1c9890d250435730656ccb4a5a31e7872b24dd79c0af8
50455045
languageName: node
50465046
linkType: hard
50475047

0 commit comments

Comments
 (0)