Unit Testing

Without automated tests:

  • every change is a challenge,

  • updating dependencies is too risky,

  • refactoring is inacceptable,

  • deployment is chaos,

  • ...

JavaScript Unit-Test Frameworks

Jasmine

https://jasmine.github.io/

Mocha

https://mochajs.org/

Jest

https://jestjs.io/

Jasmine

Example

Spies

Jasmine spies are mocks.

Fetch Mock

If you are using fetch for HTTP requests, you can use fetch-mock to mock these http requests.

http://www.wheresrhys.co.uk/fetch-mock/quickstart

Last updated