Which is better to use: qunit, mocha, jest?
Which is the best to use for unit testing? What's more relevant? are there any significant differences?
There are several important points to consider when testing:
1. Library Features
2. Testing speed
3. The popularity of the instrument
So, Jest, in my experience of use, meets all the parameters. There used to be Jasmine (this is the Jest base, as far as I know), and there was a lot of lack of parallel running tests, but Jest solved this, and now it runs tests very quickly.
Mocha is not so popular, and there is not everything out of the box, you need to either install Chai, then Sinon, and so collect the desired solution. There is no parallel test run out of the box either. Therefore, you can use it, but you will have to assemble the necessary solution for testing yourself.
I didn't use QUnit, but I always thought it was outdated.
For me, among other things, the popularity of the tool is important, because the people in the team change, the tools develop, and the more popular the tool, the (IMHO) easier it is to find specialists, plus, subjectively, such tools are usually more stable and already have solutions to typical problems that may occur later.
So I recommend Jest: +1:Audrey Hernandez
To place the code, please use CodePen or similar tool. Thanks you!