Meng Taing
1 min readDec 7, 2019

--

This is the same concept as Jest snapshot testing. Jest snapshot testing is faster and easier to write and run because it reads and writes to file. There is no point to reinvent the wheel if you’re using Javascript. Your approach may be useful for frameworks that don’t have similar snapshot testing.

Same as Jest snapshot testing, you’ll lose the ability to TDD in your approach. I appreciate your effort, but title is misleading. You should have around 80% unit tests, some integration tests, and a few e2e tests. If you mock too many things in unit tests, consider integration tests.

--

--

Meng Taing
Meng Taing

Written by Meng Taing

Fullstack developer. When life gives you a lemon, write a script to turn it into lemonade so that you don’t have to deal with it again.

No responses yet