Skip to content

Commit 092da74

Browse files
dgp1130alan-agius4
authored andcommitted
refactor: remove process.cwd from Web Test Runner builder
Turns out this isn't needed for `application` builder to correctly resolve inputs. Not using `process.cwd` should make this builder a little less brittle for monorepo use cases or when running `ng test` inside a subdirectory. (cherry picked from commit 4f53e0f)
1 parent f192e0f commit 092da74

File tree

1 file changed

+2
-4
lines changed
  • packages/angular_devkit/build_angular/src/builders/web-test-runner

1 file changed

+2
-4
lines changed

packages/angular_devkit/build_angular/src/builders/web-test-runner/index.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,7 @@ export default createBuilder(
4646
// Parallelize startup work.
4747
const [testFiles] = await Promise.all([
4848
// Glob for files to test.
49-
findTestFiles(options.include, options.exclude, ctx.workspaceRoot).then((files) =>
50-
Array.from(files).map((file) => path.relative(process.cwd(), file)),
51-
),
49+
findTestFiles(options.include, options.exclude, ctx.workspaceRoot),
5250
// Clean build output path.
5351
fs.rm(testDir, { recursive: true, force: true }),
5452
]);
@@ -66,7 +64,7 @@ export default createBuilder(
6664

6765
/** Build all the given test files and write the result to the given output path. */
6866
async function buildTests(
69-
testFiles: string[],
67+
testFiles: ReadonlySet<string>,
7068
outputPath: string,
7169
options: WtrBuilderOptions,
7270
ctx: BuilderContext,

0 commit comments

Comments
 (0)