removeIstanbulComments
setting to API which is enabled by default.Previously, inline functions like this:
<div :title="function () { return true; }">
Would produce a snapshot with flags injected into it by Istanbul, if you were running Jest with --coverage
.
<div title="function () { /* istanbul ignore next *\/ cov_1lmjj6lxv1.f[3]++; cov_1lmjj6lxv1.s[15]++; return true; }">
The random looking part of cov_1lmjj6lxv1.f[3]++;
would change depending on the machine it was running on, breaking snapshot usability.
We now remove these inserted comments by default:
<div title="function () { - /* istanbul ignore next *\/ - cov_1lmjj6lxv1.f[3]++; - cov_1lmjj6lxv1.s[15]++; return true; }">
IMPORTANT NOTE: Since Istanbul modifies the DOM when Jest is ran with it, and does not when it is ran with --coverage=false
, your snapshots that include inline functions will always fail when --coverage
is not used (or --coverage=false
is used). To learn more, and a potential workaround, see Issue #71.
PERFORMANCE NOTE: If you are not using inline functions and therefore not effected by this, you can change the removeIstanbulComments
setting to false for potentially faster test runs.
Special thanks to @cameron-martin and @luckylooke for finding and reporting the Istanbul issue.
New FeaturesRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4