WebStorm 2017.3 EAP, 173.3302: coverage reports for Jest
This week’s WebStorm 2017.3 EAP build (173.3302.13) is now available!
To learn more about the new features added in earlier WebStorm 2017.3 EAP builds, please see these blog posts.
Jest: updating snapshots and coverage reports
A new batch of improvements in the Jest integration had landed in this EAP build.
Now you can see code coverage reports for Jest tests in the IDE. The report will appear after the tests have run (select Run with coverage option instead of just Run), showing how many files were covered with tests and what percentage of lines in them are covered. From the report you can jump to the file and see which lines were covered (marked green) and which were not (marked red).
Jest has a great feature of snapshot testing. If a snapshot doesn’t match the rendered app, the test will fail. That means that either there are changes in your code that caused that or the snapshot is outdated and needs to be updated. You can update the snapshot for a failing test right from the WebStorm test tool window by clicking the “Click to update snapshot” link.
This will restart the test together with the snapshot update.
Other improvements in this EAP build include:
- Support for TypeScript 2.6;
- New run configuration type “Attach to Node.js/Chrome” that replaces “Chromium Remote” and “Node.js Remote Debug” configurations and allows connecting to the running Node.js process and Chrome.
You can find a list of all addressed issues in the Release notes.