mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2025-12-30 03:03:06 -05: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:
@@ -60,7 +60,8 @@
|
||||
"./tools/ui-components/tsconfig.json",
|
||||
"./utils/tsconfig.json",
|
||||
"./web/tsconfig.json",
|
||||
"./curriculum-server/tsconfig.json"
|
||||
"./curriculum-server/tsconfig.json",
|
||||
"./cypress/tsconfig.json"
|
||||
]
|
||||
},
|
||||
"extends": [
|
||||
|
||||
4
.github/workflows/e2e-web.yml
vendored
4
.github/workflows/e2e-web.yml
vendored
@@ -72,9 +72,9 @@ jobs:
|
||||
- browsers: electron
|
||||
spec: cypress/e2e/default/learn/challenges/projects.js
|
||||
- browsers: chrome
|
||||
spec: cypress/e2e/default/**/*.js
|
||||
spec: cypress/e2e/default/**/*.{js,ts}
|
||||
- browsers: firefox
|
||||
spec: cypress/e2e/default/**/*.js
|
||||
spec: cypress/e2e/default/**/*.{js,ts}
|
||||
services:
|
||||
mongodb:
|
||||
image: mongo:4.4
|
||||
|
||||
@@ -8,7 +8,7 @@ module.exports = defineConfig({
|
||||
projectId: 'ke77ns',
|
||||
retries: 4,
|
||||
chromeWebSecurity: false,
|
||||
specPattern: 'cypress/e2e/**/*.js',
|
||||
specPattern: ['cypress/e2e/**/*.js', 'cypress/e2e/**/*.ts'],
|
||||
setupNodeEvents(on, config) {
|
||||
config.env = config.env || {};
|
||||
on('before:run', () => {
|
||||
|
||||
8
cypress/tsconfig.json
Normal file
8
cypress/tsconfig.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es5",
|
||||
"lib": ["es5", "dom"]
|
||||
},
|
||||
"include": ["e2e/**/*.ts"],
|
||||
"extends": "../tsconfig-base.json"
|
||||
}
|
||||
@@ -14,7 +14,7 @@
|
||||
"noEmit": true,
|
||||
"resolveJsonModule": 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
|
||||
// compile the scripts to commonjs (or node will complain about the requires)
|
||||
|
||||
Reference in New Issue
Block a user