What's your preferred Node.js testing setup?

Ken Bellows - Jan 16 '20 - - Dev Community

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 than a personal side project, and I'd really like to do it right.

In pursuit of that goal, I want to introduce unit and integration tests early on in the process, but I don't have much (read: any) experience with unit tests in Node, so I'm not sure what all is out there. I've used Jasmine for AngularJS apps in the past, and while that was... rough, to say the least, I think that was more Angular's fault than Jasmine's, and I liked working with Jasmine overall. I've also heard good things about Mocha, though I've never done more than a couple toy examples myself. And I guess there's this thing called Jest that has popped up recently as well?

Are these frameworks still applicable in the server-side world? Are there newer, better frameworks I should be aware of?

How about for testing database interactions? I'd like to set up a harness that will run our migration scripts to build a little SQLite database on the fly for testing, something like that; is that the best approach?

I'm relatively new to this kind of testing, and I know we have some very experienced DEVs here, so any advice would be very welcome!

I'd also be happy to read any other articles that have been written on related subjects, so feel free to drop links!

Thanks in advance! ๐Ÿ™๐Ÿ˜

. . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player