diff options
author | Kenta Moriuchi <moriken@kimamass.com> | 2022-10-29 18:25:23 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-29 18:25:23 +0900 |
commit | 59ac110edd1f376bed7fa6bbdbe2ee09c266bf74 (patch) | |
tree | da654d1ecb6141b620141d634d99ca34c6d568db /cli/tests/unit/spawn_test.ts | |
parent | edaceecec771cf0395639175b5a21d20530f6080 (diff) |
fix(core): fix APIs not to be affected by `Promise.prototype.then` modification (#16326)
Diffstat (limited to 'cli/tests/unit/spawn_test.ts')
-rw-r--r-- | cli/tests/unit/spawn_test.ts | 17 |
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; + } + }, +); |