|
- Jest · Delightful JavaScript Testing
Jest is a JavaScript testing framework designed to ensure correctness of any JavaScript codebase It allows you to write tests with an approachable, familiar and feature-rich API that gives you results quickly
- Getting Started - Jest
You can run Jest directly from the CLI (if it's globally available in your PATH, e g by yarn global add jest or npm install jest --global) with a variety of useful options Here's how to run Jest on files matching my-test, using config json as a configuration file and display a native OS notification after the run:
- Testing React Apps · Jest
At Facebook, we use Jest to test React applications Setup Setup with Create React App If you are new to React, we recommend using Create React App It is ready to use and ships with Jest! You will only need to add react-test-renderer for rendering snapshots Run
- Jest CLI Options
The jest command line runner has a number of useful options You can run jest --help to view all available options Many of the options shown below can also be used together to run tests exactly the way you want Every one of Jest's Configuration options can also be specified through the CLI
- Expect - Jest
The TypeScript examples from this page will only work as documented if you explicitly import Jest APIs: import { expect , jest , test } from '@jest globals' ; Consult the Getting Started guide for details on how to setup Jest with TypeScript
- Globals - Jest
In your test files, Jest puts each of these methods and objects into the global environment You don't have to require or import anything to use them However, if you prefer explicit imports, you can do import {describe, expect, test} from '@jest globals'
- Testing Web Frameworks · Jest
Jest is a universal testing platform, with the ability to adapt to any JavaScript library or framework In this section, we'd like to link to community posts and articles about integrating Jest into popular JS libraries
- Configuring Jest · Jest
Jest attempts to scan your dependency tree once (up-front) and cache it in order to ease some of the filesystem churn that needs to happen while running tests This config option lets you customize where Jest stores that cache data on disk
|
|
|