Skip to content

fix(@angular/build): support injecting global styles into vitest unit-tests #30498

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

Merged
merged 1 commit into from
Jun 11, 2025

Conversation

clydin
Copy link
Member

@clydin clydin commented Jun 9, 2025

When using the experimental unit-test builder with the vitest runner,
the build option's global stylesheet file (output: styles.css) will now
be included in the generated index.html file used when browser mode is
enabled.
The global stylesheets used are currently limited to the default styles.css
output file. If custom named global stylesheets are configured, they will
not currently be injected into the test index HTML file used with browser
testing.

Closes #30444

@clydin clydin force-pushed the unit-test/global-styles branch from 0b1b819 to bdc0184 Compare June 10, 2025 22:35
@clydin clydin marked this pull request as ready for review June 11, 2025 01:30
@clydin clydin force-pushed the unit-test/global-styles branch from bdc0184 to 4a780c1 Compare June 11, 2025 01:34
@clydin clydin added target: patch This PR is targeted for the next patch release target: minor This PR is targeted for the next minor release and removed target: patch This PR is targeted for the next patch release labels Jun 11, 2025
…-tests

When using the experimental `unit-test` builder with the `vitest` runner,
the build option's global stylesheet file (output: `styles.css`) will now
be included in the generated `index.html` file used when browser mode is
enabled.
The global stylesheets used are currently limited to the default `styles.css`
output file. If custom named global stylesheets are configured, they will
not currently be injected into the test index HTML file used with browser
testing.
@clydin clydin force-pushed the unit-test/global-styles branch from 4a780c1 to d39eb31 Compare June 11, 2025 01:36
@clydin clydin requested a review from alan-agius4 June 11, 2025 12:33
@clydin clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label Jun 11, 2025
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Jun 11, 2025
@clydin clydin merged commit f177f55 into angular:main Jun 11, 2025
32 checks passed
@clydin clydin deleted the unit-test/global-styles branch June 11, 2025 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action: merge The PR is ready for merge by the caretaker area: @angular/build target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@angular/build:unit-test does not include global styles.css file
2 participants