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.

type changes not updated during watch mode

See original GitHub issue

Issue

When you make changes to the types, e.g. renaming a type, the changes cause the test to fail, even if the change actually works fine.

Need to quit jest watch and start again for the changes to be picked up correctly.

causes

My guess is that during rename, multiple files are affected and ts-jest only detect one file has been changed, so the cache of other files are not invalidated, thus containing outdated information.

This happens whenever I make changes to multiple files and save them at the same time.

Another example would be moving a type from one file to another.

Minimal repo

I encounter this in multiple situations. For example, https://github.com/unional/progress-str

To reproduce the issue, you need to run the test in watch mode (npm run watch in the repo above), and then make some changes such as rename or move types.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:21
  • Comments:26

github_iconTop GitHub Comments

14reactions
excitement-engineercommented, May 24, 2022

Also running into this issue with the most recent version of ts-jest (28.0.3), please consider reopening this issue until it is fixed. Thanks a lot.

7reactions
GerkinDevcommented, Oct 19, 2021

Having this too. Might this issue be reopened ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Jest watch not detecting changes to files - Stack Overflow
If I run npm t or npm run test:changed (my script for only running tests that cover changed files via jest -o )...
Read more >
Just-in-Time Mode - Tailwind CSS
If you want Tailwind to rebuild the CSS completely from scratch while in watch mode, saving your tailwind.config.js file or your CSS input...
Read more >
Node v18.11.0 (Current)
Notable changes. watch mode (experimental). Running in 'watch' mode using node --watch restarts the process when an imported file is changed ...
Read more >
ts-node - npm
TypeScript execution environment and REPL for node.js, with source map support. Latest version: 10.9.1, last published: 5 months ago.
Read more >
Visual Studio is not detecting changes in files and solutions ...
Are you saying that when the contents of a projects changes externally, it doesn't auto-update in VS and you are having to reload...
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