fix(testing): nullcheck polyfills in ng component testing (#16411)

This commit is contained in:
Caleb Ukle 2023-04-19 11:55:11 -05:00 committed by GitHub
parent c963393e53
commit 1ad7e3de48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -200,10 +200,15 @@ function normalizeBuildTargetOptions(
return polyfill; return polyfill;
}; };
// paths need to be unix paths for angular devkit // paths need to be unix paths for angular devkit
buildOptions.polyfills = if (buildOptions.polyfills) {
Array.isArray(buildOptions.polyfills) && buildOptions.polyfills.length > 0 buildOptions.polyfills =
? (buildOptions.polyfills as string[]).map((p) => handlePolyfillPath(p)) Array.isArray(buildOptions.polyfills) &&
: handlePolyfillPath(buildOptions.polyfills as string); buildOptions.polyfills.length > 0
? (buildOptions.polyfills as string[]).map((p) =>
handlePolyfillPath(p)
)
: handlePolyfillPath(buildOptions.polyfills as string);
}
buildOptions.main = joinPathFragments(offset, buildOptions.main); buildOptions.main = joinPathFragments(offset, buildOptions.main);
buildOptions.index = buildOptions.index =
typeof buildOptions.index === 'string' typeof buildOptions.index === 'string'