packages/jest/src/migrations/update-21-3-0/rename-test-path-pattern.md
testPathPattern to testPathPatternsRenames the testPathPattern option to testPathPatterns in the @nx/jest:jest executor configuration to align with Jest v30 CLI changes. Read more at the Jest v30 migration notes.
Rename the option in project configuration:
{
"targets": {
"test": {
"executor": "@nx/jest:jest",
"options": {
"jestConfig": "apps/myapp/jest.config.ts",
"testPathPattern": "some-regex"
}
}
}
}
{
"targets": {
"test": {
"executor": "@nx/jest:jest",
"options": {
"jestConfig": "apps/myapp/jest.config.ts",
"testPathPatterns": "some-regex"
}
}
}
}
Rename the option in project configuration with configurations:
{
"targets": {
"test": {
"executor": "@nx/jest:jest",
"options": {
"jestConfig": "apps/myapp/jest.config.ts",
"testPathPattern": "some-regex"
},
"configurations": {
"development": { "testPathPattern": "regex-dev" },
"production": { "testPathPattern": "regex-prod" }
}
}
}
}
{
"targets": {
"test": {
"executor": "@nx/jest:jest",
"options": {
"jestConfig": "apps/myapp/jest.config.ts",
"testPathPatterns": "some-regex"
},
"configurations": {
"development": { "testPathPatterns": "regex-dev" },
"production": { "testPathPatterns": "regex-prod" }
}
}
}
}
Rename the option in a target default using the @nx/jest:jest executor:
{
"targetDefaults": {
"test": {
"executor": "@nx/jest:jest",
"options": {
"jestConfig": "{projectRoot}/jest.config.ts",
"testPathPattern": "some-regex"
}
}
}
}
{
"targetDefaults": {
"test": {
"executor": "@nx/jest:jest",
"options": {
"jestConfig": "{projectRoot}/jest.config.ts",
"testPathPatterns": "some-regex"
}
}
}
}
Rename the option in a target default using the @nx/jest:jest executor as the key:
{
"targetDefaults": {
"@nx/jest:jest": {
"options": {
"jestConfig": "{projectRoot}/jest.config.ts",
"testPathPattern": "some-regex"
}
}
}
}
{
"targetDefaults": {
"@nx/jest:jest": {
"options": {
"jestConfig": "{projectRoot}/jest.config.ts",
"testPathPatterns": "some-regex"
}
}
}
}