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

Feature: @angular-devkit/build-angular:web-test-runner picks up the web test runner config #27278

Open
RobbyRabbitman opened this issue Mar 14, 2024 · 1 comment
Labels
area: devkit/build-angular devkit/build-angular:web-test-runner feature: under consideration Feature request for which voting has completed and the request is now under consideration feature Issue that requests a new feature

Comments

@RobbyRabbitman
Copy link

RobbyRabbitman commented Mar 14, 2024

Command

test

Description

When testing angular code with the web test runner, I would like to configure the web test runner via its known api. My understanding of the web test runner is, that you provide a plugin which wraps the framework of your choice. The plugin takes care of building and testing your code specific to your framework and then reports the results to the web test runner.

I tried the @angular-devkit/build-angular:web-test-runner in a monorepo and I really like it so far, but I was confused that when provided a web-test-runner.config.mjs it was ignored. Other projects in my monorepo that use the web test runner are configured via the plugin option of the web test runner config when they needed to be build framework specific.

I would love to hear your thoughts on this one! :)

Describe the solution you'd like

Create a plugin which builds and tests angular code. Make @angular-devkit/build-angular:web-test-runner call the web test runner.

Using the web test runner config would also enable to launch multiple browsers with their playwright package:

// web-test-runner.config.mjs

export default {
// ...
plugins: [angular()],
browsers: [
      playwrightLauncher({ product: 'chromium' }),
      playwrightLauncher({ product: 'firefox' }),
      playwrightLauncher({ product: 'webkit' }),
    ]
}

Angular would not introduce a new api, a developer could just use the web test runner api.

// angular.json

"test": {
          "builder": "@angular-devkit/build-angular:web-test-runner",
          "options": {
            "wtrPath": "some/non/default/path"
          }
        }

Describe alternatives you've considered

Expose the web test runner api in the options of the test target in the angular.json.

@angular-robot angular-robot bot added the feature: votes required Feature request which is currently still in the voting phase label Mar 14, 2024
Copy link
Contributor

angular-robot bot commented Mar 14, 2024

This feature request is now candidate for our backlog! In the next phase, the community has 60 days to upvote. If the request receives more than 20 upvotes, we'll move it to our consideration list.

You can find more details about the feature request process in our documentation.

@angular-robot angular-robot bot added feature: under consideration Feature request for which voting has completed and the request is now under consideration and removed feature: votes required Feature request which is currently still in the voting phase labels Mar 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: devkit/build-angular devkit/build-angular:web-test-runner feature: under consideration Feature request for which voting has completed and the request is now under consideration feature Issue that requests a new feature
Projects
None yet
Development

No branches or pull requests

2 participants