
Disadvantages of Jest Snapshot Testing
This article was originally published on bmf-tech.com . Here are some rough notes on the disadvantages of avoiding Jest snapshot testing. Disadvantages Tests Become Fragile While snapshot tests can easily detect changes in the UI, they can also fail due to changes that are not the main concern of the test (e.g., renaming a class that does not change the appearance). Unclear Assertion Expectations In snapshot tests, the assertion toMatchSnapshot() is used, but when a test fails, it can be difficult to read the expected specifications. You have to look at the differences in the snapshot to make a judgment, but the assertion is too concise, making it hard to determine what the correct state is. Delayed Test Writing Snapshot tests can only be written after the implementation is complete, as they will fail continuously otherwise, making the completion of the implementation a prerequisite. References The disadvantages of Jest are not often discussed in Japanese articles, but the following ar
Continue reading on Dev.to JavaScript
Opens in a new tab


