question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`jest.config.ts` doesn't get excluded from `tsconfig.lib.json`

See original GitHub issue

Current 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

  1. Create an Nx 13 workspace
  2. Create a lib with jest as a unit test runner
  3. Migrate to Nx 14
  4. 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:closed
  • Created a year ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
theorlovskycommented, Aug 4, 2022

it is excluded in the existing projects, it was done by one of the migrations. but new projects keep creating without it being excluded

0reactions
barbados-clemenscommented, Aug 4, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found