diff --git a/packages/theme/src/cli/utilities/theme-fs.test.ts b/packages/theme/src/cli/utilities/theme-fs.test.ts index bd546d467a5..bba296ff820 100644 --- a/packages/theme/src/cli/utilities/theme-fs.test.ts +++ b/packages/theme/src/cli/utilities/theme-fs.test.ts @@ -137,7 +137,8 @@ describe('theme-fs', () => { // Given const root = tmpDir await copyDirectoryContents(joinPath(locationOfThisFile, 'fixtures/theme'), root) - const watchSpy = vi.spyOn(chokidar, 'watch') + const mockWatcher = new EventEmitter() + const watchSpy = vi.spyOn(chokidar, 'watch').mockReturnValue(mockWatcher as any) // When const themeFileSystem = mountThemeFileSystem(root, {listing: 'modern'}) @@ -157,7 +158,8 @@ describe('theme-fs', () => { // Given const root = tmpDir await copyDirectoryContents(joinPath(locationOfThisFile, 'fixtures/theme'), root) - const watchSpy = vi.spyOn(chokidar, 'watch') + const mockWatcher = new EventEmitter() + const watchSpy = vi.spyOn(chokidar, 'watch').mockReturnValue(mockWatcher as any) // When const themeFileSystem = mountThemeFileSystem(root)