For anyone who see the news, Jest now supports snapshot testing! This is an alternate model to the typical “ok, I’m going to sit down and write some tests, simulate the DOM, etc.” How it works, explained simply:
Run Jest
Snapshots of your components are made and stored on disk
Every time you run Jest after that, if you’ve altered your code and any of the snapshots fail to match, the tests fail
You can also get more detailed than that, of course. In your test code, you can:
Take a snapshot
Simulate a button click
Take another snapshot
Simulate entering some text and clicking another button
Take another snapshot
In other words, you can get up and running immediately with some very basic and easy-to-write tests. This is huge for people who always feel like there’s no time to write tests, especially when you’re trying to get an MVP off the ground!
My eventual plan is to use Jest for testing my React front-end, and use Meteor’s testing engine for the back end.
Now that’s very interesting. My first impression from the FDA and regulatory perspective: it may be difficult to argue that this is a validation test (as the FDA considers them), however it would certainly qualify as a verification test.
The thinking with the FDA is they want developers to a) use at least one end-to-end walkthrough (such as Nightwatch), and b) more than one testing solution, so as to avoid systematic testing biases. Using multiple methodologies is specifically encouraged; and this would be welcomed as a part of most any testing strategy.
Maybe it is. I’ve kinda drunk the Facebook kool-aid, so take it with a grain of salt. But seriously, as someone who is too lazy/has no time to write tests, I’m really liking this so far.