test(attachment): exclude POSIX fsync on Windows
This commit is contained in:
@@ -76,12 +76,14 @@ export async function validateImageFile(input: SaveImageAttachment, limits: Imag
|
|||||||
async function syncDirectory(path: string): Promise<void> {
|
async function syncDirectory(path: string): Promise<void> {
|
||||||
/* v8 ignore next -- Windows cannot open directory handles; NTFS metadata journaling owns entry durability there. */
|
/* v8 ignore next -- Windows cannot open directory handles; NTFS metadata journaling owns entry durability there. */
|
||||||
if (process.platform === 'win32') return
|
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)
|
const handle = await open(path, constants.O_RDONLY)
|
||||||
try {
|
try {
|
||||||
await handle.sync()
|
await handle.sync()
|
||||||
} finally {
|
} finally {
|
||||||
await handle.close()
|
await handle.close()
|
||||||
}
|
}
|
||||||
|
/* v8 ignore stop */
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user