11import { PHPUnitXML , type TestDefinition } from '@vscode-phpunit/phpunit' ;
2- import { beforeEach , describe , expect , it , vi } from 'vitest' ;
2+ import { beforeEach , describe , expect , it } from 'vitest' ;
33import type { OutputChannel , TestItem , TestRun } from 'vscode' ;
44import type { Configuration } from '../Configuration' ;
55import type { TestCollection } from '../TestCollection/TestCollection' ;
@@ -14,23 +14,23 @@ describe('ObserverFactory', () => {
1414
1515 beforeEach ( ( ) => {
1616 const testCollection = {
17- getTestDefinition : vi . fn ( ) ,
18- resolveDatasetChild : vi . fn ( ) ,
17+ getTestDefinition : ( ) => undefined ,
18+ resolveDatasetChild : ( ) => undefined ,
1919 } as unknown as TestCollection ;
2020 outputChannel = {
21- append : vi . fn ( ) ,
22- appendLine : vi . fn ( ) ,
23- clear : vi . fn ( ) ,
24- show : vi . fn ( ) ,
21+ append : ( ) => { } ,
22+ appendLine : ( ) => { } ,
23+ clear : ( ) => { } ,
24+ show : ( ) => { } ,
2525 } as unknown as OutputChannel ;
26- const configuration = { get : vi . fn ( ) } as unknown as Configuration ;
26+ const configuration = { get : ( ) => undefined } as unknown as Configuration ;
2727 const phpUnitXML = new PHPUnitXML ( ) ;
2828 factory = new ObserverFactory ( testCollection , outputChannel , configuration , phpUnitXML ) ;
2929 } ) ;
3030
3131 it ( 'should create observers including DatasetObserver, TestResultObserver, and PrinterObserver' , ( ) => {
3232 const queue = new Map < TestDefinition , TestItem > ( ) ;
33- const testRun = { enqueued : vi . fn ( ) } as unknown as TestRun ;
33+ const testRun = { enqueued : ( ) => { } } as unknown as TestRun ;
3434 const observers = factory . create ( queue , testRun ) ;
3535
3636 expect ( observers . length ) . toBe ( 5 ) ;
@@ -41,7 +41,7 @@ describe('ObserverFactory', () => {
4141
4242 it ( 'should create new instances for each call' , ( ) => {
4343 const queue = new Map < TestDefinition , TestItem > ( ) ;
44- const testRun = { enqueued : vi . fn ( ) } as unknown as TestRun ;
44+ const testRun = { enqueued : ( ) => { } } as unknown as TestRun ;
4545 const observers1 = factory . create ( queue , testRun ) ;
4646 const observers2 = factory . create ( queue , testRun ) ;
4747
0 commit comments