Answer the question
In order to leave comments, you need to log in
How to include TypeScript for Sypress if the latter is in a subdirectory?
There is an application in Angular, Protractor was replaced with Cypress, and it was shoved into a e2e
folder (the config for it is in the same place, in the folder). tsconfig.e2e.json
Cypress (extends root).
{
"extends": "../tsconfig.json",
"compilerOptions": {
"sourceMap": false,
"outDir": "../dist/out-tsc",
"types": [
"cypress",
"node"
]
},
"include": [
"**/*.ts"
]
}
cypress.json
{
"baseUrl": "http://localhost:4201",
"fileServerFolder": ".",
"fixturesFolder": "./src/fixtures",
"integrationFolder": "./src/integration",
"pluginsFile": "./src/plugins/index",
"supportFile": false,
"video": false,
"videosFolder": "./dist/cypress/videos",
"screenshotsFolder": "./dist/cypress/screenshots",
"chromeWebSecurity": false,
"env": {
"tsConfig": "./tsconfig.e2e.json"
}
}
ng
(for example npm run e2e:single
, which corresponds to the command ng e2e
) - the tests are running.angular.json
...
"e2e": {
"builder": "@nrwl/cypress:cypress",
"options": {
"cypressConfig": "e2e/cypress.json",
"tsConfig": "e2e/tsconfig.e2e.json"
}
}
...
npm run cypress
(corresponds to command cypress open --project ./e2e
) - error:ERROR TS18002: The 'files' list in config file 'tsconfig.json' is empty.
tsconfig.e2e.json
includes are specified instead of the files array.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question