Skip to Content
Learning TypeScript 2.x - Second Edition
book

Learning TypeScript 2.x - Second Edition

by Remo H. Jansen
April 2018
Beginner content levelBeginner
536 pages
13h 21m
English
Packt Publishing
Content preview from Learning TypeScript 2.x - Second Edition

Unit tests and integration tests with Mocha

In Chapter 9, Automating Your Development Workflow, we learned the basic details of the unit tests and test-coverage reports with nyc, ts-node, Mocha, and Chai. In this chapter, we are going to learn how to test asynchronous APIs using Mocha and how to combine Mocha with other powerful tools, such as Sinon.JS, SuperTest, and Enzyme:

  • We are going to learn how to write tests for every layer of an application.
  • We are going to start by testing a math library used in the backend.
  • We will then test a web service, which consumes the math library, and a client, which consumes the web service.
  • We will finish the section by writing tests for the graphic user interface and creating some e2e tests.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering TypeScript - Fourth Edition

Mastering TypeScript - Fourth Edition

Nathan Rozentals
Learning TypeScript

Learning TypeScript

Josh Goldberg
TypeScript for Beginners

TypeScript for Beginners

Bharath Thippireddy

Publisher Resources

ISBN: 9781788391474Supplemental Content