Main concepts of Jasmine

Before we dig into so practical testing cases, here are some Jasmine concepts you should know:

  • Suites: These are written in and described by the describe blocks. They appear in the form of functions.
  • Spec definitions: it (string, function) functions. The body of this function holds the actual assertions.
  • Expectations: These are assertions that evaluate to a Boolean value. This is used to see if an input is equal to the expected value.
  • Matchers:  These are helpers for common assertions, for example, toB0 (expected), toEqual (expected).

Get TypeScript 2.x for Angular Developers now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.