]> git.ardis.lu - csvio/commitdiff
Explicitly close file handle
authorArdis Lu <ardisglu@gmail.com>
Sun, 9 Feb 2025 06:04:59 +0000 (22:04 -0800)
committerArdis Lu <ardisglu@gmail.com>
Sun, 9 Feb 2025 06:04:59 +0000 (22:04 -0800)
Dismisses "Closing a FileHandle object on garbage collection" warnings in tests.

test/utils.js

index deadbd422743894289acf19a99d3dbb462fd8baa..a6998fb0bd07a38b2eb043fc1a63555a5738622d 100644 (file)
@@ -146,7 +146,8 @@ export async function createTempFolder() {
  */
 export async function createTempFile() {
   const path = normalize(`${tmpdir()}/csvio_test_${crypto.randomUUID()}.tmp`);
-  await open(path, 'a+');
+  const handle = await open(path, 'a+');
+  await handle.close();
   return path;
 }
 
This page took 0.04289 seconds and 4 git commands to generate.