ShakaCode | ShakaCode Blog | Rails On Maui Blog | Rails | ReactJs | JavaScript | Webpack | Productivity |

JS Testing Framework Recommendations


#1

The ShakaCode team has created a small repo of test examples for comparing several JS testing framework.

This is what I have for the README.md so far:

js-promises-testing

Examples on testing promies with 3 frameworks:

Blue Tape

This is our first pick given the simple nature of what we’re testing. This article is a good summary of why it’s a good default choice: Why I use Tape Instead of Mocha & So Should You

Chai + Mocha

If you like full featured frameworks like RSpec for Rails. The downside to this is that there is a lot of extra complexity for tests that may read a bit nicer.

Ava

The API is simple and similar to Blue Tape. This sounds worth pursuing if your test suite has performance issues. Aside from that, I don’t know of a compelling reason to choose Ava over Blue Tape.

Pull requests welcome on this sample repo! We don’t have to restrict these example comparisons to just promises either.

React UI Testing

We have an example of using Chai + Mocha in the react-webpack-rails-tutorial. Most examples with React testing are using Mocha + Chai.