Which framework do you recommend for javascript unit testing (Ecmascript 6)?

Asked

Viewed 247 times

0

I will develop a web application using Ecmascript 6. I’d like to continue with the TDD Technique. What framework do you recommend for javascript unit testing (Ecmascript 6)?

  • 2

    It depends on what you want to do. I suggest Jest from Facebook specifically for the ES6 support it has. But as I said, it depends on what you need to test. I find the question a little out of scope.

  • Hello Sergio, thank you for the reply. I will develop a web application using Ecmascript 6. .

  • 1

    I believe that the unit test framework does not depend on ES6, but on the engine that will interpret the scripts/tests, probably the tests run on a server with Node.js, so Node.js will support ES5 and 6 in parallel without problems, then any test can be written in ES6 as long as you follow the framework documentation correctly.

  • 1

    Use Jest and your life will be wonderful. https://facebook.github.io/jest/

1 answer

2


This is the type of subjective question that can have several answers, also subjective, since it is the type of question that can generate answers based on opinions. I’m going to name three with quotes from their developers. In my opinion, although everyone has quality, the choice will depend on the context, but there are other options that should be very good, such as Karma or Protactor, both developed by the Angular team, and many others, each with its particularity and specificities.

Jasmine

Jasmine is a testing framework for Javascript code, it does not depend on other JS frameworks. It does not require DOM

Qunit

Powerful Unit testing javascritp framework, easy to use. It is used by Jquery projects. Jquery UI and Jquery Mobile and is capable of testing any Generico JS code, including the project itself.

Sinon

Javascript testing framework, standalone, does not depend on other frameworks.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.