summaryrefslogtreecommitdiff
path: root/cli/tests/unit/spawn_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/unit/spawn_test.ts')
-rw-r--r--cli/tests/unit/spawn_test.ts17
1 files changed, 17 insertions, 0 deletions
diff --git a/cli/tests/unit/spawn_test.ts b/cli/tests/unit/spawn_test.ts
index 149886a1c..10095be95 100644
--- a/cli/tests/unit/spawn_test.ts
+++ b/cli/tests/unit/spawn_test.ts
@@ -812,3 +812,20 @@ Deno.test(
assertStringIncludes(stdoutText, "typescript");
},
);
+
+Deno.test(
+ { permissions: { read: true, run: true } },
+ async function spawnWithPromisePrototypeThenOverride() {
+ const originalThen = Promise.prototype.then;
+ try {
+ Promise.prototype.then = () => {
+ throw new Error();
+ };
+ await Deno.spawn(Deno.execPath(), {
+ args: ["eval", "console.log('hello world')"],
+ });
+ } finally {
+ Promise.prototype.then = originalThen;
+ }
+ },
+);