Skip to content

Commit 5c8f7e6

Browse files
committed
fix: fix failed unit test on windows
1 parent a75b049 commit 5c8f7e6

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

tests/test/watcher.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ import { FileWatcherManager } from '../../src/utils/watcher.js'
88
import type * as vscode from 'vscode'
99
import type { RepositoryManager } from '../../src/test/manager.js'
1010

11-
vi.mock('vscode', ()=>{
11+
vi.mock('vscode', () => {
1212
return {
13-
Uri:{
14-
file:vi.fn((f)=>({ fsPath:f }))
15-
}
13+
Uri: {
14+
file: vi.fn((f) => ({ fsPath: f })),
15+
},
1616
}
1717
})
1818

@@ -68,7 +68,7 @@ describe('TestfileWatcher', () => {
6868
} as unknown as RepositoryManager
6969

7070
// Create the watcher instance
71-
watcher = new TestfileWatcher( mockRepositoryManager)
71+
watcher = new TestfileWatcher(mockRepositoryManager)
7272
})
7373

7474
afterEach(() => {
@@ -80,7 +80,7 @@ describe('TestfileWatcher', () => {
8080
const mock = vi.fn()
8181
FileWatcherManager.prototype['createWatchers'] = mock
8282

83-
watcher = new TestfileWatcher( mockRepositoryManager)
83+
watcher = new TestfileWatcher(mockRepositoryManager)
8484

8585
// Execute
8686
watcher.enable()
@@ -144,7 +144,7 @@ describe('TestfileWatcher', () => {
144144
// Verify
145145
expect(log.debug).toHaveBeenCalledWith('Test file deleted: /path/to/test/file.spec.js')
146146
expect(log.debug).toHaveBeenCalledWith('Affected repository are 1 repositories')
147-
expect(mockRepo1.removeSpecFile).toHaveBeenCalledWith(normalize('/path/to/test/file.spec.js'))
147+
expect(mockRepo1.removeSpecFile).toHaveBeenCalledWith('/path/to/test/file.spec.js')
148148
expect(mockRepo2.removeSpecFile).not.toHaveBeenCalled()
149149
})
150150

0 commit comments

Comments
 (0)