Skip to content

Commit

Permalink
fix(testing): nullcheck polyfills in ng component testing (#16411)
Browse files Browse the repository at this point in the history
(cherry picked from commit 1ad7e3d)
  • Loading branch information
barbados-clemens authored and FrozenPandaz committed Apr 25, 2023
1 parent 426f22a commit 857bde7
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions packages/angular/plugins/component-testing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,15 @@ function normalizeBuildTargetOptions(
return polyfill;
};
// paths need to be unix paths for angular devkit
buildOptions.polyfills =
Array.isArray(buildOptions.polyfills) && buildOptions.polyfills.length > 0
? (buildOptions.polyfills as string[]).map((p) => handlePolyfillPath(p))
: handlePolyfillPath(buildOptions.polyfills as string);
if (buildOptions.polyfills) {
buildOptions.polyfills =
Array.isArray(buildOptions.polyfills) &&
buildOptions.polyfills.length > 0
? (buildOptions.polyfills as string[]).map((p) =>
handlePolyfillPath(p)
)
: handlePolyfillPath(buildOptions.polyfills as string);
}
buildOptions.main = joinPathFragments(offset, buildOptions.main);
buildOptions.index =
typeof buildOptions.index === 'string'
Expand Down

0 comments on commit 857bde7

Please sign in to comment.