Jest 19: Immersive Watch Mode and Test Platform Improvements
facebook.github.io
facebook.github.io
I mean how is
expect(2).toBeLessThanOrEqualTo(3)
more readable than assert(2 <= 3)
Especially when we have packages like power-assert (1)A) It doesn't require transforms to bring you good messages.
B) <= is an "easy" case, but what about deep equality, recursive matchers[1], or snapshots[2]?
[1]: http://facebook.github.io/jest/docs/expect.html#expectobject... [2]: http://facebook.github.io/jest/docs/snapshot-testing.html
That's a pretty big requirement.
I usually avoid the long names like that, but doing `expect(3).toEqual(4)` isn't too bad and it allows the test runner to provide really good error messages.
1. A test that reads as natural language is easy to understand. Straightforward, declarative tests are a big win IMO. 2. This allows for better test result reporting: instead of assertion failed, the utility can tell you more (expected 4 but got 3).
Some of the GIFs in this post show how awesome the watcher mode in the new Jest release is, I'd strongly recommend giving them a look!
Only part I want from jest is own .rc file.
Took me almost half a day to an half-assed port of sorts of such an awesome tool.
(the reason I used Mocha was because it was already a dep for my integration testing and I didn't want to introduce Jest - in the end - I introduced jsdom, enzyme and nyc as well)
But an old friend who is a lot better at JS than I, still uses and loves Ava. I was wondering if anyone could come around and give me a good assessment of pros/cons between the two.