|
- Jest · Delightful JavaScript Testing
Copyright OpenJS Foundation and Jest contributors All rights reserved The OpenJS Foundation has registered trademarks and uses trademarks For a list of trademarks of the OpenJS Foundation, please see our Trademark Policy and Trademark List
- 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
- Testing React Apps · Jest
See React: Function and Class Components Reminders that with Class components, we expect Jest to be used to test props and not methods directly Now let's use React's test renderer and Jest's snapshot feature to interact with the component and capture the rendered output and create a snapshot file:
- 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
- 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 runs the code of your project as JavaScript, hence a transformer is needed if you use some syntax not supported by Node out of the box (such as JSX, TypeScript, Vue templates)
- 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
|
|
|