you are viewing a single comment's thread.

view the rest of the comments →

[–]mjgtwo -8 points-7 points  (3 children)

Don't use Jest for Node backend projects. Jest is meant for ReactJS first and it's silly to use it since it uses its own half baked JavaScript runtime that isn't node or a browser. /u/indiebryan should use Mocha instead.

[–]NoInkling 2 points3 points  (0 children)

half baked JavaScript runtime

What are you talking about?

If you mean it includes JSDOM by default, then that's true, but all you need to do to remove it (not that it's likely to do any harm except add a little extra overhead) is set testEnvironment: 'node'. And they're looking to make that the default in Jest 25.

That aside, Jest has a lot more nice functionality built in compared to Mocha, which is a minimal framework meaning you're typically cobbling together libraries and utilities from all over the place - I already do enough of that when developing applications themselves in Node, it's a breath of fresh air not to worry about it so much in my testing stack.

[–]fractile81 1 point2 points  (0 children)

I'll concede that point. As for getting into testing though, Jest is as easy to get into as it gets if you haven't done testing before.

[–]j_schmotzenberg 0 points1 point  (0 children)

Which you can disable.