diff --git a/index.test.ts b/index.test.ts index b041e3a..fc51907 100644 --- a/index.test.ts +++ b/index.test.ts @@ -137,8 +137,9 @@ test("observeFileEvents: observe directory non-recursive, open file for write, w os.platform() === "darwin" ? [] : [ - {event: "rename", path: "a"} - // Followed by a "change" event which is omitted by omitDuplicateChangeEvents + {event: "rename", path: "a"}, + {event: "change", path: "a"}, + {event: "change", path: "a"} ] ); }); @@ -157,9 +158,11 @@ test("observeFileEvents: observe directory non-recursive, open file for write, w ? [] : [ {event: "rename", path: "a"}, - // Followed by a "change" event which is omitted by omitDuplicateChangeEvents - {event: "rename", path: "b"} - // Followed by a "change" event which is omitted by omitDuplicateChangeEvents + {event: "change", path: "a"}, + {event: "change", path: "a"}, + {event: "rename", path: "b"}, + {event: "change", path: "b"}, + {event: "change", path: "b"}, ] ); }); @@ -204,7 +207,8 @@ test("observeFileEvents: observe directory non-recursive, make inner directory, os.platform() === "darwin" ? [] : [ - {event: "rename", path: "a"}, + {event: "rename", path: "a"}, + {event: "change", path: "a"}, {event: "rename", path: "c"}, {event: "rename", path: "a"} ] @@ -256,8 +260,9 @@ if (os.platform() !== "linux") { await file.close(); }, true), [ - {event: "rename", path: "a"} - // Followed by a "change" event which is omitted by omitDuplicateChangeEvents + {event: "rename", path: "a"}, + {event: "change", path: "a"}, + {event: "change", path: "a"} ] ); }); @@ -274,9 +279,11 @@ if (os.platform() !== "linux") { }, true), [ {event: "rename", path: "a"}, - // Followed by a "change" event which is omitted by omitDuplicateChangeEvents - {event: "rename", path: "b"} - // Followed by a "change" event which is omitted by omitDuplicateChangeEvents + {event: "change", path: "a"}, + {event: "change", path: "a"}, + {event: "rename", path: "b"}, + {event: "change", path: "b"}, + {event: "change", path: "b"} ] ); }); @@ -319,6 +326,7 @@ if (os.platform() !== "linux") { [ {event: "rename", path: "a"}, {event: "rename", path: `a${sep}b`}, + {event: "change", path: "a"}, {event: "rename", path: `a${sep}b`}, {event: "rename", path: "c"}, {event: "rename", path: "a"}