Back to Nx

Remove Tsconfig Option From Jest Executor

packages/jest/src/migrations/update-21-0-0/remove-tsconfig-option-from-jest-executor.md

22.7.11.7 KB
Original Source

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:

Before
json
{
  "targets": {
    "test": {
      "executor": "@nx/jest:jest",
      "options": {
        "jestConfig": "apps/myapp/jest.config.ts",
        "tsConfig": "apps/myapp/tsconfig.spec.json"
      }
    }
  }
}
After
json
{
  "targets": {
    "test": {
      "executor": "@nx/jest:jest",
      "options": {
        "jestConfig": "apps/myapp/jest.config.ts"
      }
    }
  }
}

Remove the option from a target default using the @nx/jest:jest executor:

Before
json
{
  "targetDefaults": {
    "test": {
      "executor": "@nx/jest:jest",
      "options": {
        "jestConfig": "{projectRoot}/jest.config.ts",
        "tsConfig": "{projectRoot}/tsconfig.spec.json"
      }
    }
  }
}
After
json
{
  "targetDefaults": {
    "test": {
      "executor": "@nx/jest:jest",
      "options": {
        "jestConfig": "{projectRoot}/jest.config.ts"
      }
    }
  }
}

Remove the option from a target default using the @nx/jest:jest executor as the key:

Before
json
{
  "targetDefaults": {
    "@nx/jest:jest": {
      "options": {
        "jestConfig": "{projectRoot}/jest.config.ts",
        "tsConfig": "{projectRoot}/tsconfig.spec.json"
      }
    }
  }
}
After
json
{
  "targetDefaults": {
    "@nx/jest:jest": {
      "options": {
        "jestConfig": "{projectRoot}/jest.config.ts"
      }
    }
  }
}