diff options
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/unit_node/vm_test.ts | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/cli/tests/unit_node/vm_test.ts b/cli/tests/unit_node/vm_test.ts index c43495e1d..6f190ab08 100644 --- a/cli/tests/unit_node/vm_test.ts +++ b/cli/tests/unit_node/vm_test.ts @@ -1,5 +1,5 @@ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. -import { runInNewContext } from "node:vm"; +import { isContext, runInNewContext } from "node:vm"; import { assertEquals, assertThrows, @@ -55,3 +55,15 @@ Deno.test({ } }, }); + +Deno.test({ + name: "vm isContext", + fn() { + // Currently we do not expose VM contexts so this is always false. + const obj = {}; + assertEquals(isContext(obj), false); + assertEquals(isContext(globalThis), false); + const sandbox = runInNewContext("{}"); + assertEquals(isContext(sandbox), false); + }, +}); |