Schema for internal use only

Please do not extend this schema as it is part of Nx internal usage.

@nx/jest:configuration

Add Jest Configuration to a project.

Usage

1nx generate configuration ... 2

By default, Nx will search for configuration in the default collection provisioned in workspace.json.

You can specify the collection explicitly as follows:

1nx g @nx/jest:configuration ... 2

Show what will be generated without writing to disk:

1nx g configuration ... --dry-run 2

Options

project

string

The name of the project.

setupFile

string
Default: none
Accepted values: none, angular, web-components

The setup file to be generated.

supportTsx

boolean
Default: false

Setup tsx support.

testEnvironment

string
Default: jsdom
Accepted values: jsdom, node, none

The test environment for jest.

compiler

string
Default: tsc
Accepted values: tsc, babel, swc

The compiler to use for source and tests.

js

boolean
Default: false

Use JavaScript instead of TypeScript for config files

runtimeTsconfigFileName

string

The name of the project's tsconfig file that includes the runtime source files. If not provided, it will default to tsconfig.lib.json for libraries and tsconfig.app.json for applications.

skipSerializers

boolean
Default: false

Skips the serializers required to snapshot angular templates.

skipFormat

Internal
boolean
Default: false

Skip formatting files

skipPackageJson

Internal
boolean
Default: false

Do not add dependencies to package.json.

babelJest

babel-jestDeprecated
boolean
Default: false

Use babel-jest instead of ts-jest.

Use --compiler=babel instead.

skipSetupFile

Deprecated
boolean
Default: false

Skips the setup file required for angular.

Use --setup-file instead.