`jest.config.ts` doesn't get excluded from `tsconfig.lib.json`
See original GitHub issueCurrent Behavior
If you migrate to the Nx version where jest.config.ts
was introduced, the migration will add those files to the exclude
array in tsconfig.lib.json
. However, when you generate a new lib after that, it gets generated without jest.config.ts
being excluded from tsconfig.lib.json
.
Expected Behavior
I expect some consistency here. jest.config.ts
should either be excluded from tsconfig.lib.json
or not, but not both.
Steps to Reproduce
- Create an Nx 13 workspace
- Create a lib with
jest
as a unit test runner - Migrate to Nx 14
- Create another lib
Failure Logs
–
Environment
Node : 16.15.0
OS : darwin x64
npm : 8.5.5
nx : 14.1.9
@nrwl/angular : 14.1.9
@nrwl/cypress : 14.1.9
@nrwl/detox : Not Found
@nrwl/devkit : 14.1.9
@nrwl/eslint-plugin-nx : 14.1.9
@nrwl/express : Not Found
@nrwl/jest : 14.1.9
@nrwl/js : Not Found
@nrwl/linter : 14.1.9
@nrwl/nest : Not Found
@nrwl/next : Not Found
@nrwl/node : Not Found
@nrwl/nx-cloud : Not Found
@nrwl/nx-plugin : Not Found
@nrwl/react : Not Found
@nrwl/react-native : Not Found
@nrwl/schematics : Not Found
@nrwl/storybook : 14.1.9
@nrwl/web : Not Found
@nrwl/workspace : 14.1.9
typescript : 4.6.4
---------------------------------------
Community plugins:
Issue Analytics
- State:
- Created a year ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
How to exclude files for compilation but include for testing ...
When I remove the test directory from the tsconfig.json include property i get errors in my test files for all Jest methods like...
Read more >Configuring Jest
The file will be discovered automatically, if it is named jest.config.js|ts|mjs|cjs|json . You can use --config flag to pass an explicit ...
Read more >How to configure Jest with TypeScript
Jest doesn't require any configuration to find your tests. Goes through the whole project and looks for files that look like they're tests....
Read more >TSConfig Reference - Docs on every TSConfig option
Importantly, rootDir does not affect which files become part of the compilation. It has no interaction with the include , exclude , or...
Read more >Typescript does not resolve modules through tsconfig. ...
The problem is that you have "files":[] section that only includes a file from typings. If there is a 'files' section in tsconfig.json,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
it is excluded in the existing projects, it was done by one of the migrations. but new projects keep creating without it being excluded
Actually, could you send me the project’s tsconfig, curious why it didn’t get updated in the v14 migration as it should have excluded it for you.