Skip to content

Commit

Permalink
feat(angular): support application builder for cypress component test…
Browse files Browse the repository at this point in the history
…ing (#20214)

Signed-off-by: Pascal Küsgen <pascalkuesgen@gmail.com>
  • Loading branch information
Pascalmh committed Nov 16, 2023
1 parent 94143a8 commit 5bf1a92
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/angular/plugins/component-testing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ ${e.stack ? e.stack : e}`
const buildTarget = getBuildableTarget(ctContext);

if (!buildTarget.project && !graph.nodes?.[buildTarget.project]?.data) {
throw new Error(stripIndents`Unable to find project configuration for build target.
throw new Error(stripIndents`Unable to find project configuration for build target.
Project Name? ${buildTarget.project}
Has project config? ${!!graph.nodes?.[buildTarget.project]?.data}`);
}
Expand Down Expand Up @@ -295,8 +295,8 @@ Note: this may fail, setting the correct 'sourceRoot' for ${buildContext.project
}

function withSchemaDefaults(options: any): BrowserBuilderSchema {
if (!options.main) {
throw new Error('Missing executor options "main"');
if (!options.main && !options.browser) {
throw new Error('Missing executor options "main" and "browser"');
}
if (!options.index) {
throw new Error('Missing executor options "index"');
Expand All @@ -322,6 +322,7 @@ function withSchemaDefaults(options: any): BrowserBuilderSchema {
options.outputHashing ??= 'none';
options.progress ??= true;
options.scripts ??= [];
options.main = options.main ??= options.browser;

return options;
}
Expand Down

0 comments on commit 5bf1a92

Please sign in to comment.