all blog posts

JavaScript Testing: Jasmine customization

6 Aug 2017

Make your Jasmine experience even more luscious with custom matchers and global convenience methods.
Mock global variables in your modules with jasmine.getGlobal().pi = 3.14.

JavaScript Testing: Jasmine async syntax

31 May 2017

Need to test async code? No problem for Jasmine. There is done() to inform Jasmine a test has finished running.

With jasmine.clock(), the value of new Date() can be manipulated.

Finally instructions on how to configure Babel for async/await in tests.

JavaScript Testing: Jasmine Spies

30 May 2017

Spies, the Jasmine implementation for mocks featuring spyOn and the new spyOnProperty aswell as jasmine.createSpy(Obj) and how to inspect calls made.

JavaScript Testing: Jasmine syntax

30 May 2017

The basic example contains the general test suite structure and the two most used matchers toBe() (===) and toEqual() (deep compare), followed by all the other matchers that come out of the box.

To finish some helpers for your workflow: how to only have certain tests run and how to exclude tests.

JavaScript Testing: Getting started with Jasmine

29 May 2017

Probably the most widely used JavaScript testing framework.

This tutorial covers installation, configuration and execution only. For the Jasmine syntax, see parts 2 to 4!