From 7949e493a88be9fa006a349c07e475908ad2c73d Mon Sep 17 00:00:00 2001 From: AgentEnder Date: Thu, 22 Feb 2024 14:17:16 -0500 Subject: [PATCH] fix(testing): add null checks when reading targets --- .../src/generators/configuration/lib/create-jest-config.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/jest/src/generators/configuration/lib/create-jest-config.ts b/packages/jest/src/generators/configuration/lib/create-jest-config.ts index fb19843f52f35..739f646bbc7a5 100644 --- a/packages/jest/src/generators/configuration/lib/create-jest-config.ts +++ b/packages/jest/src/generators/configuration/lib/create-jest-config.ts @@ -70,9 +70,9 @@ export async function createJestConfig( ); if ( - rootProjectConfig.targets['test']?.executor === 'nx:run-commands' - ? rootProjectConfig.targets['test']?.command !== 'jest' - : rootProjectConfig.targets['test']?.options?.jestConfig !== + rootProjectConfig.targets?.['test']?.executor === 'nx:run-commands' + ? rootProjectConfig.targets?.['test']?.command !== 'jest' + : rootProjectConfig.targets?.['test']?.options?.jestConfig !== rootJestPath ) { // Jest target has already been updated