diff --git a/src/process/capture/FilesystemCoverage.test.ts b/src/process/capture/FilesystemCoverage.test.ts index a9b419c540..b370ef4ccb 100644 --- a/src/process/capture/FilesystemCoverage.test.ts +++ b/src/process/capture/FilesystemCoverage.test.ts @@ -656,36 +656,41 @@ it.each(["nested", "outside", "no-roots"] as const)( }, ); -it("treats an observer path below a regular file as absent", async () => { - const fixture = await createTestTempDirectory("rea-observer-not-directory-"); - const root = join(fixture, "selected"); - const blocker = join(fixture, "blocker.txt"); - await mkdir(root); - await writeFile(join(root, "kept.txt"), "retain me"); - await writeFile(blocker, "not a directory"); - const observerPath = join(blocker, "capture"); - const scenario = processScenarioSchema.parse({ - executable: process.execPath, - filesystem_observation_paths: [root], - }); - try { - await expect(realpath(observerPath)).rejects.toMatchObject({ - code: "ENOTDIR", - }); - const snapshot = await snapshotRoots(scenario, undefined, undefined, { - observerPaths: [observerPath], +it.skipIf(process.platform === "win32")( + "treats an observer path below a regular file as absent", + async () => { + const fixture = await createTestTempDirectory( + "rea-observer-not-directory-", + ); + const root = join(fixture, "selected"); + const blocker = join(fixture, "blocker.txt"); + await mkdir(root); + await writeFile(join(root, "kept.txt"), "retain me"); + await writeFile(blocker, "not a directory"); + const observerPath = join(blocker, "capture"); + const scenario = processScenarioSchema.parse({ + executable: process.execPath, + filesystem_observation_paths: [root], }); + try { + await expect(realpath(observerPath)).rejects.toMatchObject({ + code: "ENOTDIR", + }); + const snapshot = await snapshotRoots(scenario, undefined, undefined, { + observerPaths: [observerPath], + }); - expect(snapshot.files.map(({ path }) => path).sort()).toEqual([ - "root_0:.", - "root_0:kept.txt", - ]); - expect(snapshot.coverage.unobserved_subtrees).toEqual([]); - expect(snapshot.truncated).toBe(false); - } finally { - await rm(fixture, { recursive: true, force: true }); - } -}); + expect(snapshot.files.map(({ path }) => path).sort()).toEqual([ + "root_0:.", + "root_0:kept.txt", + ]); + expect(snapshot.coverage.unobserved_subtrees).toEqual([]); + expect(snapshot.truncated).toBe(false); + } finally { + await rm(fixture, { recursive: true, force: true }); + } + }, +); it.skipIf(process.platform === "win32")( "propagates unexpected observer path resolution errors",