Skip to content

Commit 22b0326

Browse files
committed
refactor: use Uri.file().fsPath for spawn args, fix inline type imports
- Replace phpUnitProject() with Uri.file(phpUnitProject()).fsPath in expectSpawnCalled args to match production code behavior on Windows - Keep only cwd comparison case-insensitive (drive letter ambiguity) - Replace inline import('../../PHPUnit').TestSuiteFinished with proper top-level type imports in CollisionPrinter and OutputFormatter tests
1 parent a07e8f2 commit 22b0326

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

src/Observers/Printers/CollisionPrinter.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { afterEach, beforeEach, describe, expect, it } from 'vitest';
2-
import { EOL, PHPUnitXML, TeamcityEvent } from '../../PHPUnit';
2+
import { EOL, PHPUnitXML, TeamcityEvent, type TestSuiteFinished } from '../../PHPUnit';
33
import { phpUnitProject } from '../../PHPUnit/__tests__/utils';
44
import { CollisionPrinter } from './CollisionPrinter';
55
import { OutputFormatter } from './OutputFormatter';
@@ -29,7 +29,7 @@ describe('CollisionPrinter', () => {
2929
event: TeamcityEvent.testSuiteFinished,
3030
id: 'Recca0120\\VSCode\\Tests\\AssertionsTest',
3131
flowId: 8024,
32-
} as unknown as import('../../PHPUnit').TestSuiteFinished);
32+
} as unknown as TestSuiteFinished);
3333

3434
expect(output).toEqual('');
3535
});

src/Observers/Printers/OutputFormatter.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { afterEach, beforeEach, describe, expect, it } from 'vitest';
2-
import { EOL, PHPUnitXML, TeamcityEvent, type TestFinished } from '../../PHPUnit';
2+
import { EOL, PHPUnitXML, TeamcityEvent, type TestFinished, type TestSuiteFinished } from '../../PHPUnit';
33
import { phpUnitProject } from '../../PHPUnit/__tests__/utils';
44
import { OutputFormatter } from './OutputFormatter';
55

@@ -117,7 +117,7 @@ describe('OutputFormatter', () => {
117117
event: TeamcityEvent.testSuiteFinished,
118118
id: 'Recca0120\\VSCode\\Tests\\AssertionsTest',
119119
flowId: 8024,
120-
} as unknown as import('../../PHPUnit').TestSuiteFinished);
120+
} as unknown as TestSuiteFinished);
121121

122122
expect(output).toBeUndefined();
123123
});

src/extension.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ describe('Extension Test', () => {
374374
expectSpawnCalled([
375375
binary,
376376
'--group=integration',
377-
phpUnitProject('tests/AttributeTest.php'),
377+
Uri.file(phpUnitProject('tests/AttributeTest.php')).fsPath,
378378
'--colors=never',
379379
'--teamcity',
380380
]);
@@ -386,7 +386,7 @@ describe('Extension Test', () => {
386386
expectSpawnCalled([
387387
binary,
388388
filterPattern('test_passed'),
389-
phpUnitProject('tests/AssertionsTest.php'),
389+
Uri.file(phpUnitProject('tests/AssertionsTest.php')).fsPath,
390390
'--colors=never',
391391
'--teamcity',
392392
]);
@@ -404,7 +404,7 @@ describe('Extension Test', () => {
404404
expectSpawnCalled([
405405
binary,
406406
filterPattern('test_passed'),
407-
phpUnitProject('tests/AssertionsTest.php'),
407+
Uri.file(phpUnitProject('tests/AssertionsTest.php')).fsPath,
408408
'--colors=never',
409409
'--teamcity',
410410
]);
@@ -467,7 +467,7 @@ describe('Extension Test', () => {
467467

468468
expectSpawnCalled([
469469
binary,
470-
phpUnitProject('tests/AssertionsTest.php'),
470+
Uri.file(phpUnitProject('tests/AssertionsTest.php')).fsPath,
471471
'--colors=never',
472472
'--teamcity',
473473
]);
@@ -485,7 +485,7 @@ describe('Extension Test', () => {
485485
expectSpawnCalled([
486486
binary,
487487
filterPattern('test_passed'),
488-
phpUnitProject('tests/AssertionsTest.php'),
488+
Uri.file(phpUnitProject('tests/AssertionsTest.php')).fsPath,
489489
'--colors=never',
490490
'--teamcity',
491491
]);
@@ -562,7 +562,7 @@ describe('Extension Test', () => {
562562
expectSpawnCalled([
563563
binary,
564564
filterPattern(method),
565-
phpUnitProject('tests/AssertionsTest.php'),
565+
Uri.file(phpUnitProject('tests/AssertionsTest.php')).fsPath,
566566
'--colors=never',
567567
'--teamcity',
568568
'--functional',

0 commit comments

Comments
 (0)