HN user

jeffmo

22 karma
Posts0
Comments10
View on HN
No posts found.

At 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.

Internally we use jstransform (github.com/facebook/jstransform) because it allows us to plug in individual transforms more easily. It's also what React uses for it's jsx transformations.

jstransform also ships with a few es6 features out of the box (classes, arrow functions, etc -- and the number is growing!), but Traceur definitely has more.

jasmine and mocha are test frameworks (they're the things that supply your describe() and it() functions), but they don't really supply you with everything you need to get set up to run tests.

jest is a test runner that includes a few additional things to try to make all aspects of writing and running tests a little easier...such as:

* Searches for tests to find + execute so that you can put tests near the modules they are testing

* Runs tests in parallel processes so that your test runs finish sooner

* Replace's node's built-in require() function with a custom one that acts almost entirely the same -- except (by default) it returns mocked versions of modules (rather than the real things) when your tests run

* Gives you a fake DOM implementation (using jsdom) so that you can test code that depends on DOM APIs on the command line without having to boot up a browser

(Hi, I'm the fb eng who wrote Jest)

Yea, I'd really like to add support for other testing frameworks 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 as well (like Mocha, QUnit, etc) in the future.