I got one project which contains JavaScript code. No unit tests were written for JavaScript code.

So it is feasible or beneficial to write unit test cases using Jasmine Framework for code?

What are benefits or challenges may I face while doing this?

  • 3
    As opposed to what? Not writing tests? Writing tests not using Jasmine? If you're asking about adding tests to existing code generally, there are whole books on this. – jonrsharpe May 4 '17 at 12:23

The benefits over other JavaScript testing frameworks are really opinionated, you need to find the one you like yourself.

Here is what Jasmine has to say about itself:

Jasmine is a behavior-driven development framework for testing your JavaScript code. It does not depend on any other JavaScript frameworks. It does not require a DOM.

I would research Jest, it is based on Jasmine (build by Facebook). It includes everything you would need from a testing tool. Including mocking, code-coverage and more, but it sells it as Zero configuration, thus very easy to setup.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.