File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
packages/angular/build/src/builders/unit-test Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -331,6 +331,15 @@ function findBrowserProvider(
331
331
}
332
332
}
333
333
334
+ function normalizeBrowserName ( browserName : string ) : string {
335
+ // Normalize browser names to match Vitest's expectations for headless but also supports karma's names
336
+ // e.g., 'ChromeHeadless' -> 'chrome', 'FirefoxHeadless'
337
+ // and 'Chrome' -> 'chrome', 'Firefox' -> 'firefox'.
338
+ const normalized = browserName . toLowerCase ( ) ;
339
+
340
+ return normalized . replace ( / h e a d l e s s $ / , '' ) ;
341
+ }
342
+
334
343
function setupBrowserConfiguration (
335
344
browsers : string [ ] | undefined ,
336
345
debug : boolean ,
@@ -378,8 +387,10 @@ function setupBrowserConfiguration(
378
387
const browser = {
379
388
enabled : true ,
380
389
provider,
390
+ headless : browsers . some ( ( name ) => name . toLowerCase ( ) . includes ( 'headless' ) ) ,
391
+
381
392
instances : browsers . map ( ( browserName ) => ( {
382
- browser : browserName ,
393
+ browser : normalizeBrowserName ( browserName ) ,
383
394
} ) ) ,
384
395
} ;
385
396
You can’t perform that action at this time.
0 commit comments