Answer the question
In order to leave comments, you need to log in
Which is better to use: qunit, mocha, jest?
What is better to use for unit testing? What is more relevant? are there any significant differences?
Answer the question
In order to leave comments, you need to log in
There are several important points when testing:
1. Library features
2. Testing speed
3. Popularity of the tool
So, according to my experience, Jest meets all the parameters. There used to be Jasmine (it's the base of Jest, as far as I know), and there was a lot of lack of parallel test execution, but Jest solved this, and now it runs tests very quickly.
Mocha is not so popular, and not everything is available out of the box, you either need to install Chai, then Sinon, and so collect the right solution. There is no parallel launch of tests out of the box either. Therefore, you can use it, but you will have to assemble the right solution for testing yourself.
QUnit did not use, but always thought it was an obsolete contraption
For me, among other things, the popularity of the tool is important, because people in the team change, tools develop, and the more popular the tool, the (IMHO) it is easier to find specialists, plus, subjectively, such tools are usually more stable and already have solutions for typical tasks that may occur later.
Therefore, I recommend Jest :+1:
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question