mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
feat: enable TypeScript for Cypress (#48701)
* feat: enable TypeScript for Cypress * fix: run both js and ts in workflow
This commit is contained in:
+2
-1
@@ -60,7 +60,8 @@
|
|||||||
"./tools/ui-components/tsconfig.json",
|
"./tools/ui-components/tsconfig.json",
|
||||||
"./utils/tsconfig.json",
|
"./utils/tsconfig.json",
|
||||||
"./web/tsconfig.json",
|
"./web/tsconfig.json",
|
||||||
"./curriculum-server/tsconfig.json"
|
"./curriculum-server/tsconfig.json",
|
||||||
|
"./cypress/tsconfig.json"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"extends": [
|
"extends": [
|
||||||
|
|||||||
@@ -72,9 +72,9 @@ jobs:
|
|||||||
- browsers: electron
|
- browsers: electron
|
||||||
spec: cypress/e2e/default/learn/challenges/projects.js
|
spec: cypress/e2e/default/learn/challenges/projects.js
|
||||||
- browsers: chrome
|
- browsers: chrome
|
||||||
spec: cypress/e2e/default/**/*.js
|
spec: cypress/e2e/default/**/*.{js,ts}
|
||||||
- browsers: firefox
|
- browsers: firefox
|
||||||
spec: cypress/e2e/default/**/*.js
|
spec: cypress/e2e/default/**/*.{js,ts}
|
||||||
services:
|
services:
|
||||||
mongodb:
|
mongodb:
|
||||||
image: mongo:4.4
|
image: mongo:4.4
|
||||||
|
|||||||
+1
-1
@@ -8,7 +8,7 @@ module.exports = defineConfig({
|
|||||||
projectId: 'ke77ns',
|
projectId: 'ke77ns',
|
||||||
retries: 4,
|
retries: 4,
|
||||||
chromeWebSecurity: false,
|
chromeWebSecurity: false,
|
||||||
specPattern: 'cypress/e2e/**/*.js',
|
specPattern: ['cypress/e2e/**/*.js', 'cypress/e2e/**/*.ts'],
|
||||||
setupNodeEvents(on, config) {
|
setupNodeEvents(on, config) {
|
||||||
config.env = config.env || {};
|
config.env = config.env || {};
|
||||||
on('before:run', () => {
|
on('before:run', () => {
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "es5",
|
||||||
|
"lib": ["es5", "dom"]
|
||||||
|
},
|
||||||
|
"include": ["e2e/**/*.ts"],
|
||||||
|
"extends": "../tsconfig-base.json"
|
||||||
|
}
|
||||||
+1
-1
@@ -14,7 +14,7 @@
|
|||||||
"noEmit": true,
|
"noEmit": true,
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"types": ["node", "jest", "@testing-library/jest-dom"]
|
"types": ["node", "jest", "@testing-library/jest-dom", "cypress"]
|
||||||
},
|
},
|
||||||
// since ts-node compiles ts on the fly and then uses node, it needs to
|
// since ts-node compiles ts on the fly and then uses node, it needs to
|
||||||
// compile the scripts to commonjs (or node will complain about the requires)
|
// compile the scripts to commonjs (or node will complain about the requires)
|
||||||
|
|||||||
Reference in New Issue
Block a user