test(attachment): exclude POSIX fsync on Windows

This commit is contained in:
creatixchu
2026-08-10 12:06:01 +08:00
parent fb37107ca4
commit 12c971d4b9

View File

@@ -76,12 +76,14 @@ export async function validateImageFile(input: SaveImageAttachment, limits: Imag
async function syncDirectory(path: string): Promise<void> {
/* v8 ignore next -- Windows cannot open directory handles; NTFS metadata journaling owns entry durability there. */
if (process.platform === 'win32') return
/* v8 ignore start -- Windows cannot exercise directory fsync; POSIX behavior tests enforce this peer. */
const handle = await open(path, constants.O_RDONLY)
try {
await handle.sync()
} finally {
await handle.close()
}
/* v8 ignore stop */
}
/**