Skip to content

Commit 8f79e6b

Browse files
alan-agius4dgp1130
authored andcommitted
test: refactor vitest include e2e test
Refactored the vitest e2e include test to also include testing relative paths. (cherry picked from commit cb8dea8)
1 parent f392cd7 commit 8f79e6b

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

tests/legacy-cli/e2e/tests/vitest/absolute-include.ts

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import assert from 'node:assert/strict';
2+
import { applyVitestBuilder } from '../../utils/vitest';
3+
import { ng } from '../../utils/process';
4+
import path from 'node:path';
5+
6+
export default async function (): Promise<void> {
7+
await applyVitestBuilder();
8+
9+
const { stdout: stdout1 } = await ng('test', '--include', path.resolve('src/app/app.spec.ts'));
10+
assert.match(stdout1, /1 passed/, 'Expected 1 test to pass with absolute include.');
11+
12+
const { stdout: stdout2 } = await ng('test', '--include', path.normalize('src/app/app.spec.ts'));
13+
assert.match(stdout2, /1 passed/, 'Expected 1 test to pass with relative include.');
14+
}

0 commit comments

Comments
 (0)