Skip to content
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

Watch doesn't update test result when problem is fixed (only on Error) #668

Closed
gregid opened this issue Feb 15, 2021 · 2 comments · Fixed by #674
Closed

Watch doesn't update test result when problem is fixed (only on Error) #668

gregid opened this issue Feb 15, 2021 · 2 comments · Fixed by #674

Comments

@gregid
Copy link

gregid commented Feb 15, 2021

Environment

  1. node -v: v14.5.0
  2. npm -v: 6.14.5
  3. npm ls jest or npm ls react-scripts (if you haven’t ejected): [email protected]
  4. Operating system: Windows_NT x64 10.0.19042
  5. VS Code: 1.53.2

Prerequisite

  • are you able to run jest test from command line? YES
  • how do you run your tests from command line? npm run jest

Steps to Reproduce

  1. I have working (passing) test unit, I introduce a typo, save file => error shown in PROBLEMS tab + error markers in the file
  2. I fix typo, save file => error still in the PROBLEMS tab + error markers in the file
  3. I introduce new typo => new (correct) error in the PROBLEMS tab + error markers in the file
  4. I fix new typo, save file => error still in the PROBLEMS tab + error markers in the file
  5. restarting jest watcher clears PROBLEMS tab + success markers in the file until next error.

Relevant Debug Info

It appeared on async test.

Expected Behavior

vscode-jest should update test result after error is fixed

Actual Behavior

vscode-jest doesn't update test result when problem is fixed, it updates only on new errors.

Other

I haven't worked on the project for a while, so I don't know when it stopped working, but it used to work fine before.

It looks like an ephemeral issue - after reproducing the steps for few dozen times it finally started working correctly. Still posting this issue in case anyone knows what is happening and why.

@gregid
Copy link
Author

gregid commented Feb 15, 2021

Correction - it just came back after I removed all the additional lines I introduced in the file since last git commit.

If the file is being returned to the state of the last commit jest watch will not run on this file leaving the PROBLEMS tab with errors and test file with error markers.

Commiting the file before running steps to reproduce is crucial for the issue to appear.

@connectdotz
Copy link
Collaborator

For people with problems with watchman or "jest watch", there is an alternative now: we have added a new "interactive mode" independent of the watchman in the latest v4.0.0-alpha.5, please feel free to give it a try and let us know if it works for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants