Skip to content

fix(@schematics/angular): skip webWorkerTsConfig for unit-test builder test targets - #34386

Open
MeAkib wants to merge 1 commit into
angular:mainfrom
MeAkib:fix/web-worker-unit-test
Open

MeAkib wants to merge 1 commit into
angular:mainfrom
MeAkib:fix/web-worker-unit-test

Conversation

@MeAkib

@MeAkib MeAkib commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

The web-worker schematic added the webWorkerTsConfig option to the project's test target regardless of its builder. New applications use the @angular/build:unit-test builder, which does not have this option, so ng test failed schema validation with Unknown option "webWorkerTsConfig" after generating a web worker.

The option is no longer added to test targets that use the unit-test builder, which reads build options from its buildTarget. Other test builders, such as Karma, still receive the option.

Fixes #34385

…der test targets

The `web-worker` schematic added the `webWorkerTsConfig` option to the project's
`test` target regardless of its builder. New applications use the
`@angular/build:unit-test` builder, which does not have this option, so
`ng test` failed schema validation with `Unknown option "webWorkerTsConfig"`
after generating a web worker.

The option is no longer added to `test` targets that use the unit-test builder,
which reads build options from its `buildTarget`. Other test builders, such as
Karma, still receive the option.

Fixes angular#34385

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request updates the web-worker schematic to prevent adding the 'webWorkerTsConfig' option to a test target when the builder is 'Builders.BuildUnitTest', as this builder does not support that option and instead reads it from the build target. It also adds corresponding unit tests to verify this behavior for both unit-test and karma builders. I have no feedback to provide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ng generate web-worker adds webWorkerTsConfig to the @angular/build:unit-test target, breaking ng test

1 participant