Просмотр исходного кода

fix(core): fix file watcher test (#18698)

James Long 5 месяцев назад
Родитель
Сommit
84d9b38873
1 измененных файлов с 11 добавлено и 7 удалено
  1. 11 7
      packages/opencode/test/file/watcher.test.ts

+ 11 - 7
packages/opencode/test/file/watcher.test.ts

@@ -177,13 +177,17 @@ describeWatcher("FileWatcher", () => {
     await withWatcher(tmp.path, Effect.void)
 
     // Now write a file — no watcher should be listening
-    await Effect.runPromise(
-      noUpdate(
-        tmp.path,
-        (e) => e.file === file,
-        Effect.promise(() => fs.writeFile(file, "gone")),
-      ),
-    )
+    await Instance.provide({
+      directory: tmp.path,
+      fn: () =>
+        Effect.runPromise(
+          noUpdate(
+            tmp.path,
+            (e) => e.file === file,
+            Effect.promise(() => fs.writeFile(file, "gone")),
+          ),
+        ),
+    })
   })
 
   test("ignores .git/index changes", async () => {