diff options
Diffstat (limited to 'tests/testdata/test/trace_ops_caught_error/main.ts')
-rw-r--r-- | tests/testdata/test/trace_ops_caught_error/main.ts | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/testdata/test/trace_ops_caught_error/main.ts b/tests/testdata/test/trace_ops_caught_error/main.ts new file mode 100644 index 000000000..8194a8b2a --- /dev/null +++ b/tests/testdata/test/trace_ops_caught_error/main.ts @@ -0,0 +1,12 @@ +Deno.test("handle thrown error in async function", async () => { + const dirPath = Deno.makeTempDirSync(); + const filePath = `${dirPath}/file.txt`; + try { + await Deno.stat(filePath); + } catch { + await Deno.writeTextFile(filePath, ""); + } finally { + await Deno.remove(filePath); + await Deno.remove(dirPath); + } +}); |