Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from Nov 16, 2023

Conversation

Pascalmh
Copy link
Contributor

Current Behavior

Using the Application Builder as the executor the "component-test" target fails using cypress because the main property in the options-object was renamed to browser.

Expected Behavior

Use the browser property when the main property is missing.

See: https://angular.io/guide/esbuild#using-the-application-builder

Copy link

vercel bot commented Nov 13, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated (UTC)
nx-dev ⬜️ Ignored (Inspect) Visit Preview Nov 13, 2023 2:47pm

Signed-off-by: Pascal Küsgen <pascalkuesgen@gmail.com>
@Pascalmh Pascalmh force-pushed the angular-component-testing-ng17 branch from 7add667 to bb4f2c4 Compare November 13, 2023 14:46
@leosvelperez leosvelperez changed the title feat(angular): support application builder feat(angular): support application builder for cypress component testing Nov 16, 2023
@leosvelperez leosvelperez merged commit 5bf1a92 into nrwl:master Nov 16, 2023
6 checks passed
@Pascalmh Pascalmh deleted the angular-component-testing-ng17 branch November 16, 2023 13:13
@@ -322,6 +322,7 @@ function withSchemaDefaults(options: any): BrowserBuilderSchema {
options.outputHashing ??= 'none';
options.progress ??= true;
options.scripts ??= [];
options.main = options.main ??= options.browser;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

options.main ??= options.browser;

I'd also move the options check after this, so you only have 1 condition/branch:

if (!options.main) {
  throw new Error('Missing executor options "main" and "browser"');
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, removed the check here: #20382

I like the co-location of the checks that throw errors more then having only a single condition/branch.

Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants