feat(angular): support application builder for cypress component testing (#20214)

Signed-off-by: Pascal Küsgen <pascalkuesgen@gmail.com>
This commit is contained in:
Pascal Küsgen 2023-11-16 04:08:45 -08:00 committed by GitHub
parent 94143a8734
commit 5bf1a928e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -73,7 +73,7 @@ ${e.stack ? e.stack : e}`
const buildTarget = getBuildableTarget(ctContext); const buildTarget = getBuildableTarget(ctContext);
if (!buildTarget.project && !graph.nodes?.[buildTarget.project]?.data) { 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} Project Name? ${buildTarget.project}
Has project config? ${!!graph.nodes?.[buildTarget.project]?.data}`); Has project config? ${!!graph.nodes?.[buildTarget.project]?.data}`);
} }
@ -295,8 +295,8 @@ Note: this may fail, setting the correct 'sourceRoot' for ${buildContext.project
} }
function withSchemaDefaults(options: any): BrowserBuilderSchema { function withSchemaDefaults(options: any): BrowserBuilderSchema {
if (!options.main) { if (!options.main && !options.browser) {
throw new Error('Missing executor options "main"'); throw new Error('Missing executor options "main" and "browser"');
} }
if (!options.index) { if (!options.index) {
throw new Error('Missing executor options "index"'); throw new Error('Missing executor options "index"');
@ -322,6 +322,7 @@ function withSchemaDefaults(options: any): BrowserBuilderSchema {
options.outputHashing ??= 'none'; options.outputHashing ??= 'none';
options.progress ??= true; options.progress ??= true;
options.scripts ??= []; options.scripts ??= [];
options.main = options.main ??= options.browser;
return options; return options;
} }