Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

File is not under 'rootDir' in Cypress tsconfig.json

$
0
0

I'm trying to configure Cypress in my Project. I bumped into a problem with the typescript configuration for Cypress and I need your help!This is how my project looks like:

fronend/    - cypress/        -tsconfig.json    - src/    - tsconfig.json    - package.json    - cypreess.json

This is my tsconfig.json from Cypress directory:

{"extends": "../tsconfig.json","include": ["./**/*.ts"],"exclude": [],"compilerOptions": {"types": ["cypress"],"lib": ["es2015", "dom"],"isolatedModules": false,"composite": true  }}

This is my tsconfig.json file from frontend directory:

{"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/"    }  ]}

The Cypress can work fine without "extends": "../tsconfig.json" but I need it because I would like to export files from src directory in my cypress ts files.

Can you please give me ideas about what is wrong with my configurations?I would prefer to do not to change the main tsconfig.json file because it runs our UI.This is my error:

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.

Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>