Skip to content

Commit

Permalink
fix(testing): fix ts-jest migration (nrwl#3900)
Browse files Browse the repository at this point in the history
  • Loading branch information
FrozenPandaz authored and Doginal committed Nov 25, 2020
1 parent 5d86e8b commit 2596e14
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions packages/jest/migrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@
"version": "10.3.0-beta.1",
"description": "Adds a jest extension to the recommended extensions for vscode",
"factory": "./src/migrations/update-10-3-0/add-jest-extension"
},
"update-ts-jest": {
"version": "10.3.1-beta.1",
"description": "Fix ts-jest migration",
"factory": "./src/migrations/update-10-3-0/update-ts-jest"
}
},
"packageJsonUpdates": {
Expand Down
7 changes: 5 additions & 2 deletions packages/jest/src/migrations/update-10-3-0/update-ts-jest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@ function updateAstTransformers(): Rule {
join(appRootPath, target.options.jestConfig as string)
);

if (!config.globals?.['ts-jest']?.astTransformers) {
return;
if (
!config.globals?.['ts-jest']?.astTransformers ||
!Array.isArray(config.globals?.['ts-jest']?.astTransformers)
) {
continue;
}

try {
Expand Down

0 comments on commit 2596e14

Please sign in to comment.