summaryrefslogtreecommitdiff
path: root/tests/unit_node/vm_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit_node/vm_test.ts')
-rw-r--r--tests/unit_node/vm_test.ts16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/unit_node/vm_test.ts b/tests/unit_node/vm_test.ts
index b557350ad..21e56ee94 100644
--- a/tests/unit_node/vm_test.ts
+++ b/tests/unit_node/vm_test.ts
@@ -132,3 +132,19 @@ Deno.test({
assertEquals(isContext(sandbox), false);
},
});
+
+// https://github.com/denoland/deno/issues/23297
+Deno.test({
+ name: "vm context promise rejection",
+ fn() {
+ const code = `
+function reject() {
+ return Promise.reject(new Error('rejected'));
+}
+reject().catch(() => {})
+ `;
+
+ const script = new Script(code);
+ script.runInNewContext();
+ },
+});