-
Notifications
You must be signed in to change notification settings - Fork 455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jest --watchAll with ts-jest cannot find property/function if it was defined after its corresponding test case #1122
Comments
This seems like a more general issue, I'm also experiencing something similar in my project with both the Any files imported from tests are not updated when the file content has changed. Example:
If the error is fixed ( Jest's Will downgrade to see if I can get it working. My
Versions: |
Downgrading didn't seem to help (tried Maybe this is actually a big issue @kulshekhar @huafu? |
Here's a workaround npm script that I'm using for a watch mode for now until this is fixed:
|
Thanks, mate. I will try out the workaround. |
Also ran into this. Any progress on this issue? Anything else we can provide to help debug this? |
seems to have similar issue with #943 |
I experienced the same and was very confused: I made a minimal proof of concept in this repo: Steps to reproduce:
|
Issue :
jest --watchAll does not recognize new exports in source file if corresponding test was written first (and thus failed). Instead continues to throw following error:
and one needs to restart jest for the new property 'add' to be recognized.
If one writes the 'add' function first and then the test, it works fine.
Expected behavior :
I expect jest to throw the above error when it can't find the function/method that's being called in the test but then once the function/method is added, it should find it and run the test properly.
Debug log:
log file content
Minimal repo :
https://github.com/KerimG/typescript-starter
Just add following to main.test.ts
before defining the "add" function in main.ts
I initially thought that this might be a jest issue but tried the same with my "pure" node repository and could not reproduce the issue there. I think it's a ts-jest issue.
Versions:
"jest": "^24.8.0",
"ts-jest": "^24.0.2",
The text was updated successfully, but these errors were encountered: