4. Jasmine tests

Jasmine is an open source testing framework from Pivotal Labs that uses behaviour-driven notation resulting in a fluent and improved testing experience.

Main concepts:

  1. Suites — describe(string, function) functions, take a title and a function containing one or more specs.

  2. Specs — it(string, function) functions, take a title and a function containing one or more expectations.

  3. Expectations — are assertions that evaluate to true or false. Basic syntax reads expect(actual).toBe(expected)

  4. Matchers — are predefined helpers for common assertions. Eg: toBe(expected), toEqual(expected). Find a complete list here.

Last updated