4 ms·
Wish all it was was a mocking library... w/o the testing built in. That way you could use it easily with Mocha (and should, etc).
by pajtai 12y ago
Wish all it was was a mocking library... w/o the testing built in.
That way you could use it easily with Mocha (and should, etc).
- jeffmo 12y ago(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.
- glenjamin 12y agoThis looks really neat, having to re-specify the interface of the collaborators is generally a bunch of boilerplate you don't want to need! Did you consider building on top of Sinon.JS and only having jest do the require/detect/build-mock part? Your mock API seems very similar.
- jeffmo 12y agoI hadn't looked at Sinon.JS before, but it does seem worth checking into...thanks!
- waterfowl 12y agothis is awesome. thank you for your work.
- skeeterbug 12y agoAny plans to support AMD or just commonjs?
- chadhietala 12y agoYou can use this https://github.com/Jakobo/redefine https://github.com/Jakobo/redefine
- chadhietala 12y agoYou might want to look at http://www.venusjs.org/ http://www.venusjs.org/ to get some ideas for supporting multiple testing frameworks. It uses an annotation approach kind of how you include files for tests. The automatic mocking is pretty awesome though.
- jestar_jokin 12y agoHave you looked at JsMockito?
- TimJRobinson 12y agoI use sinon (function mocking) and proxyquire (mock requires) for mocking with mocha and they work well.