@@ -14,6 +14,7 @@ import path from 'node:path';
1414import { createVirtualModulePlugin } from '../../tools/esbuild/virtual-module-plugin' ;
1515import { assertIsError } from '../../utils/error' ;
1616import { loadEsmModule } from '../../utils/load-esm' ;
17+ import { toPosixPath } from '../../utils/path' ;
1718import { buildApplicationInternal } from '../application' ;
1819import type {
1920 ApplicationBuilderExtensions ,
@@ -117,7 +118,7 @@ export async function* execute(
117118
118119 buildTargetOptions . polyfills = injectTestingPolyfills ( buildTargetOptions . polyfills ) ;
119120
120- const outputPath = path . join ( context . workspaceRoot , generateOutputPath ( ) ) ;
121+ const outputPath = toPosixPath ( path . join ( context . workspaceRoot , generateOutputPath ( ) ) ) ;
121122 const buildOptions : ApplicationBuilderInternalOptions = {
122123 ...buildTargetOptions ,
123124 watch : normalizedOptions . watch ,
@@ -156,10 +157,11 @@ export async function* execute(
156157 `import { BrowserTestingModule, platformBrowserTesting } from '@angular/platform-browser/testing';` ,
157158 '' ,
158159 normalizedOptions . providersFile
159- ? `import providers from './${ path
160- . relative ( projectSourceRoot , normalizedOptions . providersFile )
161- . replace ( / .[ m c ] ? t s $ / , '' )
162- . replace ( / \\ / g, '/' ) } '`
160+ ? `import providers from './${ toPosixPath (
161+ path
162+ . relative ( projectSourceRoot , normalizedOptions . providersFile )
163+ . replace ( / .[ m c ] ? t s $ / , '' ) ,
164+ ) } '`
163165 : 'const providers = [];' ,
164166 '' ,
165167 // Same as https://github.com/angular/angular/blob/05a03d3f975771bb59c7eefd37c01fa127ee2229/packages/core/testing/src/test_hooks.ts#L21-L29
@@ -406,7 +408,7 @@ function generateCoverageOption(
406408 return {
407409 enabled : true ,
408410 excludeAfterRemap : true ,
409- include : [ `${ path . relative ( workspaceRoot , outputPath ) } /**` ] ,
411+ include : [ `${ toPosixPath ( path . relative ( workspaceRoot , outputPath ) ) } /**` ] ,
410412 // Special handling for `reporter` due to an undefined value causing upstream failures
411413 ...( codeCoverage . reporters
412414 ? ( { reporter : codeCoverage . reporters } satisfies VitestCoverageOption )
0 commit comments