K
K
Konstantin2020-10-06 16:51:00
JavaScript
Konstantin, 2020-10-06 16:51:00

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?

  • qunit
  • jest
  • mocha

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Yakimchuk, 2020-10-06
@kostyakos52000

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 question

Ask a Question

731 491 924 answers to any question