From a4f0c451185d596c550c009984235d41e97e37f0 Mon Sep 17 00:00:00 2001 From: Alfonso Noriega Date: Mon, 6 Jul 2026 19:24:56 +0200 Subject: [PATCH] Avoid real file watchers in theme-fs tests Assisted-By: devx/56dcddb4-0bb1-4e96-b794-1bb2fda2cba1 --- packages/theme/src/cli/utilities/theme-fs.test.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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)