DEV Community

Cover image for What's your favorite JS testing framework?
Madza
Madza Subscriber

Posted on

What's your favorite JS testing framework?

Nowadays, the industry is dominated by agile development and tight deadlines. Manual unit testing can be complex and time-consuming, so it makes sense to rely on automated frameworks.

Some of the favorites include: Jest, Mocha, Jasmine, Karma.

Do you unit test your code and what's your favorite testing framework?

Latest comments (23)

Collapse
 
madza profile image
Madza

Thanks for the valuable insight πŸ’―πŸ‘βœ¨

Collapse
 
andrewbaisden profile image
Andrew Baisden

Jest, Enzyme, React Testing Library and Cypress.

Collapse
 
madza profile image
Madza

Thanks for the input πŸ™β€

Collapse
 
mage_ai profile image
Mage AI

We use React on our frontend, so Jest and Enzyme are our preferred JS testing frameworks. Since these are quite popular, there are also a lot of great resources out there on using them, and Jest is even recommended in React's docs.

Collapse
 
ashoutinthevoid profile image
Full Name • Edited

I use tape for most purposes. Simple, lightweight, works as well today as it did years and years ago. It's also very similar to Rust's built-in test runner, so when I move between languages the context switch is that much lighter.

I also personally dislike the bdd test style (thus I wouldn't use a framework that only provides that option, assuming the choice is mine). Not for any technical reasons that actually matter, just personal taste. So much noise for the same results.

Collapse
 
madza profile image
Madza

Thanks for the input πŸ‘πŸ˜‰

Collapse
 
fredericbonnet profile image
FrΓ©dΓ©ric Bonnet

For unit tests my favorite combo is Mocha/Chai, plus Sinon if I need mocks (though it's rarely the case for unit testing). For dev E2E I'm a big fan of CodeceptJS, far superior to Cypress IMHO.

Collapse
 
madza profile image
Madza

Thanks for the insight πŸ™β€

Collapse
 
jcubic profile image
Jakub T. Jankiewicz • Edited

I use Jest and Ava, Ava was the only framework that allow async tests loading, so it was the only option for my Scheme interpreter.

Collapse
 
madza profile image
Madza

Thanks for the input πŸ™β€

Collapse
 
knopkem profile image
Michael Knopke

Cypress. But only for frontend testing (integration testing is awesome), jest for backend, nodejs testing.

Collapse
 
madza profile image
Madza

Oh, yeah, heard about that too πŸ˜‰πŸ‘

Collapse
 
vonheikemen profile image
Heiker

ava is the one I like the most. Very similar to tape but adds some convenient features.

Collapse
 
madza profile image
Madza

Thanks for the input πŸ™β€

Collapse
 
siddharthshyniben profile image
Siddharth

Jest for now, though I'm building my own!

I try to build my own <everything>. I'm building my own framework, my own ghost, my own programming language, etc.

Collapse
 
madza profile image
Madza

Awesome to hear, best of luck in you projects πŸ‘πŸ˜‰

Collapse
 
joelbonetr profile image
JoelBonetR πŸ₯‡

The QA dept. πŸ˜‚πŸ˜‚πŸ˜‚

Collapse
 
madza profile image
Madza

Haha, made my day πŸ˜„πŸ˜„