Snažím se nakonfigurovat Cypress v mém Projektu. Narazil jsem na problém s strojopis konfigurace pro Cypress a já potřebuji vaši pomoc! To je, jak můj projekt vypadá:
fronend/
- cypress/
-tsconfig.json
- src/
- tsconfig.json
- package.json
- cypreess.json
Tohle je můj tsconfig.json z Cypřiše adresáře:
{
"extends": "../tsconfig.json",
"include": ["./**/*.ts"],
"exclude": [],
"compilerOptions": {
"types": ["cypress"],
"lib": ["es2015", "dom"],
"isolatedModules": false,
"composite": true
}
}
Tohle je můj tsconfig.json souboru z rozhraní adresáře:
{
"compilerOptions": {
"baseUrl": "src",
"rootDir": "src",
"target": "es6",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react"
},
"include": ["./src/**/*.ts", "./src/**/*.tsx", "./src/**/*.svg"],
"exclude": ["node_modules", "scripts"],
"references": [
{
"path": "./cypress/"
}
]
}
Cypress může pracovat v pohodě i bez "extends": "../tsconfig.json"
ale já to potřebuju, protože bych rád export souborů z src adresář v mém cypress ts soubory.
Můžete mi prosím dát představy o tom, co je špatně s mojí konfigurací? Já bych raději ne-li změnit hlavní tsconfig.json souboru, protože to běží naše UI. To je moje chyba:
File '/**/fronend/cypress/support/objects/client.ts' is not under 'rootDir' '/**/frontend/src'. 'rootDir' is expected to contain all source files.
The file is in the program because:
Imported via '../../support/client' from file '/**/frontend/cypress/integration/EndToEndTests.spec.ts'
Matched by include pattern './**/*.ts' in '/**/frontend/cypress/tsconfig.json'ts(6059)
tsconfig.json(3, 15): File is matched by include pattern specified here.