4 ms·
Shorter feedback loop is always great. Running tests in parallel is a non-brainer. Leveraging Jasmine is great too. Glad to see it's not reinventing the wheel!
by chenglou 12y ago
Shorter feedback loop is always great. Running tests in parallel is a non-brainer.
Leveraging Jasmine is great too. Glad to see it's not reinventing the wheel!
Here's another interesting part, on dependency injection: http://facebook.github.io/jest/docs/common-js-testing.html#content http://facebook.github.io/jest/docs/common-js-testing.html#c...
- caiob 12y agoIt's great that they're improving an existing/familiar tool like Jasmine. Also, I love the way they treat CommonJS modules.
- nawitus 12y agoI would've built Jest on top of Mocha. It's a slightly better testing framework, especially when it comes to async tests.
- joshuacc 12y agoIn what way? Jasmine 2.0 introduced Mocha-style done() for async tests.
- nawitus 12y agoOh, that's great :). That happened after I evaluated Jasmine the last time.
- vjeux 12y agoMock functions are a really powerful tool. They let you test asynchronous functions in an entirely synchronous way. Because of that, Jest doesn't need to provide special support for asynchronous testing http://facebook.github.io/jest/docs/tutorial.html#content http://facebook.github.io/jest/docs/tutorial.html#content
- couchand 12y agoThat might work for simple cases but I'd be worried that switching all your asynchronous calls to synchronous has the potential to introduce bugs that your tests would then miss. Testing asynchronous functions is hard for lots of reasons, and only one of them is that you have to wait for it to finish.
- jeffmo 12y agoAt some point I'd like to add support for using mocha within Jest as well. Right now we use jasmine internally, so I was pretty focused on getting it running with that. However, it is (quite intentionally) built such that the 'jasmine' parts are pretty isolated similar to a plug-in; So it should be possible to build plug-ins for other frameworks like Mocha as well at some point.