DEV Community

What's your preferred Node.js testing setup?

Ken Bellows on January 16, 2020

I'm currently working on building a new Node.js application from the ground up at work. This is the first time I've done this for anything other th...
Collapse
 
dorshinar profile image
Dor Shinar • Edited

As far as test runners go, I think mocha and jest go neck and neck and are quite equal - although jest is easier to set up.
I really like Chai's chainable assertions, as they allow you to make complex assertions with ease, compared to jest's non-chainable ones.
The strongest point of jest is the jack-of-all-trades approach, when you don't need any other library for your tests.

Collapse
 
adisreyaj profile image
Adithya Sreyaj

Jest is just fantastic.

For mocking,stubbing etc Sinon is a good choice.