Unit testing frameworks

There are many JavaScript unit testing frameworks available, and also a few that have been written in TypeScript. Two of the most popular JavaScript frameworks are Jasmine (http://jasmine.github.io/) and QUnit (http://qunitjs.com/). If you are writing Node TypeScript code, then you might want to have a look at mocha (https://github.com/mochajs/mocha/wiki).

Two of the TypeScript-based testing frameworks are MaxUnit (https://github.com/KnowledgeLakegithub/MaxUnit) and tsUnit (https://github.com/Steve-Fenton/tsUnit). Unfortunately, both MaxUnit and tsUnit are newcomers in this space, and therefore may not have the features that are inherent in the older, more popular frameworks. MaxUnit, for example, did not have any documentation at the time of writing, and tsUnit does not have a test reporting framework compatible with CI build servers. Over time, these TypeScript frameworks may grow, but seeing how easy it is to work with third-party libraries and use DefinitelyTyped declaration files, writing unit tests for either QUnit or Jasmine becomes a very simple process.

For the rest of this chapter, we will be using Jasmine 2.0 as our testing framework.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.181.34