Skip to content

fix(@angular/build): proxy karma request from / to /base #30632

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
Jul 1, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/angular/build/src/builders/karma/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,17 @@ function getBuiltInKarmaConfig(
// Any changes to the config here need to be synced to: packages/schematics/angular/config/files/karma.conf.js.template
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this apply? Do we need to sync this?

Copy link
Collaborator Author

@alan-agius4 alan-agius4 Jul 1, 2025

Choose a reason for hiding this comment

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

No, as the build-angular package uses it’s how karma .html files, where the base href is hardcoded

return {
basePath: '',
rootUrl: '/',
frameworks: ['jasmine'],
plugins: [
'karma-jasmine',
'karma-chrome-launcher',
'karma-jasmine-html-reporter',
'karma-coverage',
].map((p) => workspaceRootRequire(p)),
proxies: {
'/': '/base/',
},
jasmineHtmlReporter: {
suppressAll: true, // removes the duplicated traces
},
Expand Down