diff --git a/.eslintrc.json b/.eslintrc.json index d0bd5161184..6104de87af7 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -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": [ diff --git a/.github/workflows/e2e-web.yml b/.github/workflows/e2e-web.yml index c014b5e96e2..2713112cd4a 100644 --- a/.github/workflows/e2e-web.yml +++ b/.github/workflows/e2e-web.yml @@ -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 diff --git a/cypress.config.js b/cypress.config.js index c8c0856bd72..9a93b25c086 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -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', () => { diff --git a/cypress/e2e/default/learn/challenges/backend.js b/cypress/e2e/default/learn/challenges/backend.ts similarity index 100% rename from cypress/e2e/default/learn/challenges/backend.js rename to cypress/e2e/default/learn/challenges/backend.ts diff --git a/cypress/tsconfig.json b/cypress/tsconfig.json new file mode 100644 index 00000000000..c24d3ad33a8 --- /dev/null +++ b/cypress/tsconfig.json @@ -0,0 +1,8 @@ +{ + "compilerOptions": { + "target": "es5", + "lib": ["es5", "dom"] + }, + "include": ["e2e/**/*.ts"], + "extends": "../tsconfig-base.json" +} diff --git a/tsconfig-base.json b/tsconfig-base.json index cea38b99a1f..05a91303e8c 100644 --- a/tsconfig-base.json +++ b/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)