Run Jest unit tests.
@nx/jest
Package reference
Here is a list of all the executors, generators and migrations available from this package.
Executors
Generators
initInternal
Initialize the
@nx/jestplugin.configurationInternal
Add Jest configuration to a project.
Convert existing Jest project(s) using
@nx/jest:jestexecutor to use@nx/jest/plugin.
Migrations
21.0.x
20.0.x
19.6.x
19.2.x
remove-tsconfig-option-from-jest-executor
Remove the previously deprecated and unused `tsConfig` option from the `@nx/jest:jest` executor.
Remove tsConfig Option from Jest Executor
Removes the previously deprecated and unused tsConfig option from the @nx/jest:jest executor configuration in all projects.
Examples
Remove the option from the project configuration:
1{
2  "targets": {
3    "test": {
4      "executor": "@nx/jest:jest",
5      "options": {
6        "jestConfig": "apps/myapp/jest.config.ts",
7        "tsConfig": "apps/myapp/tsconfig.spec.json"
8      }
9    }
10  }
11}
12Remove the option from a target default using the @nx/jest:jest executor:
1{
2  "targetDefaults": {
3    "test": {
4      "executor": "@nx/jest:jest",
5      "options": {
6        "jestConfig": "{projectRoot}/jest.config.ts",
7        "tsConfig": "{projectRoot}/tsconfig.spec.json"
8      }
9    }
10  }
11}
12Remove the option from a target default using the @nx/jest:jest executor as the key:
1{
2  "targetDefaults": {
3    "@nx/jest:jest": {
4      "options": {
5        "jestConfig": "{projectRoot}/jest.config.ts",
6        "tsConfig": "{projectRoot}/tsconfig.spec.json"
7      }
8    }
9  }
10}
11replace-getJestProjects-with-getJestProjectsAsync-v21
Replace usage of `getJestProjects` with `getJestProjectsAsync`.
Replace Usage of getJestProjects with getJestProjectsAsync
Replaces the usage of the removed getJestProjects function with the getJestProjectsAsync function.
Sample Code Changes
1import { getJestProjects } from '@nx/jest';
2
3export default {
4  projects: getJestProjects(),
5};
6replace-getJestProjects-with-getJestProjectsAsync
Replace usage of `getJestProjects` with `getJestProjectsAsync`.
Replace Usage of getJestProjects with getJestProjectsAsync
Replaces the usage of the deprecated getJestProjects function with the getJestProjectsAsync function.
Sample Code Changes
1import { getJestProjects } from '@nx/jest';
2
3export default {
4  projects: getJestProjects(),
5};
619.6.0-package-updates
Packages
| Name | Version | Always Add to package.json | 
|---|---|---|
| jest | ~29.7.0 | Update only | 
| @types/jest | ~29.5.12 | Update only | 
| expect | ~29.7.0 | Update only | 
| @jest/globals | ~29.7.0 | Update only | 
| jest-jasmine2 | ~29.7.0 | Update only | 
| jest-environment-jsdom | ~29.7.0 | Update only | 
| babel-jest | ~29.7.0 | Update only | 
19.2.0-package-updates
Packages
| Name | Version | Always Add to package.json | 
|---|---|---|
| @swc/jest | ~0.2.36 | Update only |