Skip to content

Commit 21e7648

Browse files
authored
fix(testing): add null checks when reading targets (#21952)
1 parent 836012b commit 21e7648

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/jest/src/generators/configuration/lib/create-jest-config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ export async function createJestConfig(
7070
);
7171

7272
if (
73-
rootProjectConfig.targets['test']?.executor === 'nx:run-commands'
74-
? rootProjectConfig.targets['test']?.command !== 'jest'
75-
: rootProjectConfig.targets['test']?.options?.jestConfig !==
73+
rootProjectConfig.targets?.['test']?.executor === 'nx:run-commands'
74+
? rootProjectConfig.targets?.['test']?.command !== 'jest'
75+
: rootProjectConfig.targets?.['test']?.options?.jestConfig !==
7676
rootJestPath
7777
) {
7878
// Jest target has already been updated

0 commit comments

Comments
 (0)