TL;DR

  • Mocha and Jasmine lead the pack.
  • Overall, developers are not happy about JavaScript testing.

Like the rest of Javascript world, the testing landscape is highly competitive one, with rapid release cycles, feature and performance comparisons, and constant one-upsmanship between the frameworks.

Testing

Filter:
  • All
  • Interest
  • Satisfaction
Show:
  • Percents
  • Numbers
  • Never heard of it
  • Heard of it, not interested
  • Heard of it, would like to learn
  • Used it before, would not use again
  • Used it before, would use again

Overall, Mocha and Jasmine stand tall, each having roughly 90% awareness and high degrees of interest and satisfaction. In contrast, the rest of the field remains relatively unknown.

The data shows something fascinating about the relationship between satisfaction and interest: the more people are satisfied with a framework, the more other people are more likely to be interested in learning it.

Mocha, Jasmine, and Enzyme lead the pack with high scores in both satisfaction and interest. Jest and Cucumber bring up the rear with relatively low scores in both categories.

This makes intuitive sense, but it's actually a bit surprising. It seems to indicate that marketing is a non-factor in the Javascript testing world, and that each framework is succeeding on its own merit. That might be a first!

At 24% awareness, newcomer Ava lacks community mindshare. But with reasonably high interest and satisfaction scores, we can expect that to change in the future.

For fun, I wrote a Gherkin spec for Cucumber's satisfaction rating:

Given you are testing JS,
When you try Cucumber,
Then you'd rather not use it again.

OK that's a little unfair. After all, it's no Coffeescript. But it does stick out like a sore thumb in the testing category.

How likely are testing framework users to also use other technologies?

Plain JavaScriptES6CoffeeScriptTypeScriptElmClojureScriptNo FrameworkReactAngularAngular 2EmberVueBackboneReduxMobXRelayREST APIFirebaseGraphQLApolloFalcorHorizonMeteorFeathersJSDoneJSMERNMEANMochaJasmineEnzymeJestCucumberAvaPlain CSSSASS/SCSSLESSCSS ModulesAphroditeWebpackGruntGulpBrowserifyBowerNative AppsReact NativeCordovaPhoneGapNativeScript
Mocha
2
34
3
5
8
7
-3
32
-1
2
8
-1
9
33
7
9
17
9
13
5
5
3
2
3
0
12
12
100
42
30
16
15
8
-1
11
8
12
4
33
0
8
13
-7
5
15
2
1
0
Jasmine
5
20
3
15
4
3
-2
12
18
15
5
-3
10
13
1
3
15
9
5
0
4
1
1
0
1
4
17
42
100
9
15
17
0
0
15
14
5
-1
17
11
13
9
6
5
5
8
7
2
Enzyme
-1
18
-1
-3
6
7
-6
33
-11
-6
1
-3
-1
38
15
14
6
7
17
8
6
5
1
3
4
13
-4
30
9
100
27
8
21
0
3
-1
21
13
28
-7
-5
3
-14
0
18
-7
-7
-1
Jest
-2
11
1
-1
7
7
-2
19
-5
-1
4
0
1
21
9
17
2
5
15
7
8
5
0
4
4
7
0
16
15
27
100
8
10
-2
2
1
10
13
16
-4
-2
4
-7
4
16
-3
-3
-1
Cucumber
0
5
9
1
3
4
-3
6
2
1
9
-1
7
5
2
4
6
4
6
4
9
3
5
2
3
1
4
15
17
8
8
100
4
-1
8
5
2
1
5
3
4
5
3
6
5
5
3
1
Ava
-1
11
1
2
10
6
0
13
-5
-1
1
2
0
14
10
9
2
5
10
9
8
6
-1
6
4
10
-1
8
0
21
10
4
100
-1
-1
-2
10
16
13
-7
0
5
-9
0
11
-2
-2
1

Note: “user” defined as people who picked “I've used it before, and would use it again”. Phi coefficient values go from -100 to +100, darker red indicates stronger positive correlation, darker blue indicates stronger negative correlation.

The single strongest correlation in the testing category, is Mocha and Jasmine. Not only are people generally happy with both frameworks, but people who are happy with one tend to be happy with the other!

Mocha has an edge over Jasmine when it comes to newer technologies: it tends to be co-used with ES6, React, Redux, and Webpack. We can also see a tech hipster factor in the data as well: Enzyme and Ava appear to cluster a little bit with CSS Modules and Aphrodite.

Recommended Resources

Presented by Egghead.io

React Testing Cookbook

Trevor Miller
In this course we will take a look at testing React applications. From getting setup and running tests, all the way through testing Redux enabled React applications.

Unit testing a React component using Jasmine and Webpack

Simon Bailey
An introduction on unit testing a ReactJS component using Webpack and Jasmine.
Thanks to our partners for supporting this project. Check them out for more awesome programming courses!

Other Testing Tools

Of the remaining write-in frameworks, Javascript users love them some Tape. Javascript author Eric Elliott makes a case for it in his essay Why I use Tape Instead of Mocha & So Should You.

Other popular write-ins include jQuery's testing framework qUnit, the test runner Karma, and Angular's protractor.

Given the lack of satisfaction among Javascript testers, I would not be surprised to see a different set of options a year from now.

On a scale of 1 to 5, how happy are you with your current testing solution?

Show:
  • Percents
  • Numbers

Javascript testers are not a happy bunch. In addition to receiving one of the lower happiness scores of different aspects of the Javascript ecosystem, the write-in responses were a minefield of expletives.

Some choice samples:

  • Those are all super @#$^%!
  • Most 'things' are honestly just way too #&!%ing @#$^% to take seriously. Really!
  • Testing is %&!!@#$^

Tell us what you really think people! Additionally, many people wrote in that they don't do any automated testing. Based on this feedback, it's unclear whether the dissatisfaction is due to the existing set of tools, or whether people are just unhappy with testing in general.

But as the Javascript testing world churns on like the rest of the JS ecosystem, hopefully we can see solutions on the way.

About the Author

Michael Shilman

Founder of Lab80, a FinTech development studio, and Hellomoney, Reddit's tool of choice for portfolio visualization and peer feedback.