/jest-examples

Jest testing examples project

Primary LanguageJavaScript

jest-test-examples

Jest testing examples project

Examples

In this project Jest is used with Webpack, Vanilla JS without a framework. The examples include:

  • Expect (to be true/false/equal)
  • Test setup/teardown (beforeEach, beforeAll, afterEach, afterAll)
  • Spy (check on call method)
  • Mock
  • Async testing
  • Coverage

Don't forget

  • it and test can be used equally
  • does not matter if the test file is named spec.js or test.js

Documentation on Jest

Official jest documentation For matchers, go to jest-extended