Skip to content

Commit

Permalink
Migrate Cypress from ESM to CJS format, upgrade Cypress
Browse files Browse the repository at this point in the history
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
  • Loading branch information
contolini committed Aug 2, 2023
1 parent d0fa4ef commit 8fd72e1
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 44 deletions.
11 changes: 3 additions & 8 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,14 @@
"@typescript-eslint/member-ordering": "off",
"@typescript-eslint/prefer-includes": "off",
"@typescript-eslint/no-restricted-imports": "off",
"@typescript-eslint/no-misused-promises": [
"error",
{
"checksVoidReturn": false
}
],

"import/no-deprecated": "error",
"import/order": "off",
"import/no-extraneous-dependencies": [
"error",
{
"devDependencies": [
"cypress.config.ts",
"cypress.config.js",
"vite.config.ts",
"src/setupTests.ts",
"src/testUtils.tsx",
Expand Down Expand Up @@ -175,7 +170,7 @@
}
},
{
"files": ["vite.config.ts", "cypress.config.ts"],
"files": ["vite.config.ts"],
"parserOptions": {
"project": ["./tsconfig.node.json"]
}
Expand Down
48 changes: 24 additions & 24 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
4 changes: 2 additions & 2 deletions cypress.config.ts → cypress.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineConfig } from 'cypress';
const { defineConfig } = require('cypress');

export default defineConfig({
module.exports = defineConfig({
fileServerFolder: 'dist',
fixturesFolder: false,
projectId: 'etow1b',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"autoprefixer": "^10.4.14",
"commitizen": "4.3.0",
"css-mediaquery": "0.1.2",
"cypress": "12.12.0",
"cypress": "12.17.2",
"cz-conventional-changelog": "3.3.0",
"debug": "^4.3.4",
"eslint": "^8.45.0",
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.node.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"baseUrl": "./.yarn/cache",
"composite": true,
"forceConsistentCasingInFileNames": true,
"isolatedModules": true,
Expand All @@ -10,5 +11,5 @@
"strict": true,
"target": "ESNext"
},
"include": ["vite.config.ts", "cypress.config.ts"]
"include": ["vite.config.ts"]
}
16 changes: 8 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1812,7 +1812,7 @@ __metadata:
languageName: node
linkType: hard

"@cypress/request@npm:^2.88.10":
"@cypress/request@npm:^2.88.11":
version: 2.88.11
resolution: "@cypress/request@npm:2.88.11"
dependencies:
Expand Down Expand Up @@ -4382,7 +4382,7 @@ __metadata:
autoprefixer: ^10.4.14
commitizen: 4.3.0
css-mediaquery: 0.1.2
cypress: 12.12.0
cypress: 12.17.2
cz-conventional-changelog: 3.3.0
debug: ^4.3.4
design-stories: "cfpb/design-stories#0.0.1"
Expand Down Expand Up @@ -4993,11 +4993,11 @@ __metadata:
languageName: node
linkType: hard

"cypress@npm:12.12.0":
version: 12.12.0
resolution: "cypress@npm:12.12.0"
"cypress@npm:12.17.2":
version: 12.17.2
resolution: "cypress@npm:12.17.2"
dependencies:
"@cypress/request": ^2.88.10
"@cypress/request": ^2.88.11
"@cypress/xvfb": ^1.2.4
"@types/node": ^14.14.31
"@types/sinonjs__fake-timers": 8.1.1
Expand Down Expand Up @@ -5034,14 +5034,14 @@ __metadata:
pretty-bytes: ^5.6.0
proxy-from-env: 1.0.0
request-progress: ^3.0.0
semver: ^7.3.2
semver: ^7.5.3
supports-color: ^8.1.1
tmp: ~0.2.1
untildify: ^4.0.0
yauzl: ^2.10.0
bin:
cypress: bin/cypress
checksum: 5ab0a8bc58c8af90cdb5fea93692422e6e74436ffdaeb41853e91a3fcfcdb7a39ad6ae512537bf0edf25cc3bc3732248a32e8ad3bec3440d5f527f3a3b4650b7
checksum: 19144db1fe02d92270de71f69ece324affd2f60bafa2f7018440c00907f837b1f8556926206df8b6e7b1c9890d250435730656ccb4a5a31e7872b24dd79c0af8
languageName: node
linkType: hard

Expand Down

0 comments on commit 8fd72e1

Please sign in to comment.