node -v: 9.3.0npm -v: 5.5.1npm ls react-scripts (if you haven鈥檛 ejected): -
Operating system: Windows 10
"jest.runAllTestsFirst": trueCode coverage overlay should be available for the whole time and the whole project.
Code coverage overlay works during the initial full test run, but disappears as soon as jest shows No tests found related to files changed since last commit..
As soon as one saves an edit in a covered file code coverage reappears for all tested files (not just the edited one).
If necessary, I could provide a sample repository and further instructions.
Good timing @stephtr, I've been working on this issue this morning.
When we handle new JSON results from Jest with the updateWithData method, most of the updates are performed by iterating over the empty testResults array (which causes no action). Unlike the test results, the coverage map is empty and causes (or at least should cause) the overlay to be removed. To prevent this, we need to bypass the coverage overlay update when the JSON update was preceeded by "No tests found" is on stderr.
@orta, are you OK with a PR to fix this in jest-editor-support? I'm just cleaning up the tests that add an argument when we emit the JSON data:
this.emit('executableJSON', JSON.parse(data), {noTestsFound});
Yep, makes sense to me