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.

All tests re-run on every change

See original GitHub issue

Environment

  1. node -v: 8.11.1

  2. npm -v: 5.6.0

  3. Operating system: macOS High Sierra

Steps to Reproduce

Save a change to any specific test.

Expected Behavior

Only the changed file’s tests are re-run, leading to quick feedback on test success/failure as a result of the change.

Actual Behavior

All tests in the entire project are re-run, potentially taking a very long time before finding out if the one modified test passes/fails.

This appears to be a regression due to #325 . As one who didn’t have problems with the previous behavior, it would be very nice if this could at least be made an optional setting for those who need it.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:7
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
seanpoultercommented, May 18, 2018

The --watch option will use Git or Mercurial to detect the changed files. This is the default mode. Using --watchAll will rerun everything when any file changes. The long game is to:

  • add an option in the settings that allows folks who aren’t using Git or Mercurial to use watch mode in some capacity
  • detect when jest --watch fails because Git or Mercurial have not been configured and start jest --watch with a notification to the user

I’m unfamiliar with the root cause of #325, but it should be relatively straight forward to investigate.

2reactions
seanpoultercommented, May 17, 2018

Also … HUGE thanks for debugging this. 🎉

Read more comments on GitHub >

github_iconTop Results From Across the Web

Rerun unit tests affected by change [closed]
It seems like every bit of data required to build the list of affected tests is in place: set of changed lines could...
Read more >
Watches code and tests for changes, rerunning tests ... - testthat
Details. The current strategy for rerunning tests is as follows: if any code has changed, then those files are reloaded and all tests...
Read more >
How to run Gradle test when all tests are UP-TO-DATE?
Gradle will unpack the test results from the build cache after the output has been cleaned, so nothing will be rerun. In short,...
Read more >
Rerun and debug tests | PyCharm Documentation - JetBrains
PyCharm lets you rerun run/debug configuration of a test automatically, if the source code has been changed. To enable autotest-like runner ...
Read more >
Run jest for unit tests of modified files only | by SunCommander
We tackled this by referring to this. We checked if any package version has changed, then run all the tests, else run with...
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