diff options
| author | Asher Gomez <ashersaupingomez@gmail.com> | 2024-01-22 10:20:59 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-22 00:20:59 +0100 |
| commit | 983c745d4f385594638c42c107dca7d55afd0731 (patch) | |
| tree | 2c184d26ea3344b82543117d25bb99e49ba876e9 /cli/tests/unit/serve_test.ts | |
| parent | 568337f3f43ef050cbbd95995f94e39663530ab4 (diff) | |
chore: use `FsFile[Symbol.dispose]()` (#22007)
This change takes advantage of explicit resources management for
`FsFile` instances and tweaks documentation to encourage the use of it.
---------
Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com>
Diffstat (limited to 'cli/tests/unit/serve_test.ts')
| -rw-r--r-- | cli/tests/unit/serve_test.ts | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/cli/tests/unit/serve_test.ts b/cli/tests/unit/serve_test.ts index 9226a9bd2..e188932ac 100644 --- a/cli/tests/unit/serve_test.ts +++ b/cli/tests/unit/serve_test.ts @@ -2567,10 +2567,9 @@ function makeTempData(size: number) { async function makeTempFile(size: number) { const tmpFile = await Deno.makeTempFile(); - const file = await Deno.open(tmpFile, { write: true, read: true }); + using file = await Deno.open(tmpFile, { write: true, read: true }); const data = makeTempData(size); await file.write(data); - file.close(); return await Deno.open(tmpFile, { write: true, read: true }); } |
