Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export async function findTests(
});

for (const match of globMatches) {
resolvedTestFiles.add(match);
resolvedTestFiles.add(toPosixPath(match));
}
}

Expand Down Expand Up @@ -261,15 +261,15 @@ async function resolveStaticPattern(
for (const infix of TEST_FILE_INFIXES) {
const potentialSpec = join(dirname(fullPath), `${baseName}${infix}${fileExt}`);
if (await exists(potentialSpec)) {
return { resolved: [potentialSpec], unresolved: [] };
return { resolved: [toPosixPath(potentialSpec)], unresolved: [] };
}
}

if (await exists(fullPath)) {
return { resolved: [fullPath], unresolved: [] };
return { resolved: [toPosixPath(fullPath)], unresolved: [] };
}

return { resolved: [], unresolved: [pattern] };
return { resolved: [], unresolved: [toPosixPath(pattern)] };
}

/** Checks if a path exists and is a directory. */
Expand Down
12 changes: 0 additions & 12 deletions tests/legacy-cli/e2e/tests/vitest/absolute-include.ts

This file was deleted.

14 changes: 14 additions & 0 deletions tests/legacy-cli/e2e/tests/vitest/include.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import assert from 'node:assert/strict';
import { applyVitestBuilder } from '../../utils/vitest';
import { ng } from '../../utils/process';
import path from 'node:path';

export default async function (): Promise<void> {
await applyVitestBuilder();

const { stdout: stdout1 } = await ng('test', '--include', path.resolve('src/app/app.spec.ts'));
assert.match(stdout1, /1 passed/, 'Expected 1 test to pass with absolute include.');

const { stdout: stdout2 } = await ng('test', '--include', path.normalize('src/app/app.spec.ts'));
assert.match(stdout2, /1 passed/, 'Expected 1 test to pass with relative include.');
}
Loading