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?
Top comments (23)
Thanks for the valuable insight π―πβ¨
We use Jest, and I've been pretty happy with it overall. I'm not so deep into this type of work any more, but every time I need something I find it easy enough to follow along with what I'm seeing in the files and/or find useful docs and guides.
I still remember reading your post on the DEVs tech stack and I was impressed seeing all the pieces working together so well π
Jest has proven itself as a solid framework, with lots of devs trusting it.
According to npmtrends:
We've since simplified the tech stack a little bit, but yes we have had a focus on maintaining a good test suite and having the tools that support stability as much as we can.
Slow Tests
i.e. your test runner shouldn't be part of the problem - that's why uvu exists.
This is insightful, thanks ππ
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.
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.
Thanks for the input ππ
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.Awesome to hear, best of luck in you projects ππ
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.
Thanks for the insight πβ€
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.
Thanks for the input πβ€
Jest, Enzyme, React Testing Library and Cypress.
Thanks for the input πβ€
Cypress. But only for frontend testing (integration testing is awesome), jest for backend, nodejs testing.
Oh, yeah, heard about that too ππ