aboutsummaryrefslogtreecommitdiff
path: root/test/js/node/vm/vm.test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'test/js/node/vm/vm.test.ts')
-rw-r--r--test/js/node/vm/vm.test.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/js/node/vm/vm.test.ts b/test/js/node/vm/vm.test.ts
index 99ec07ce2..982d5eed9 100644
--- a/test/js/node/vm/vm.test.ts
+++ b/test/js/node/vm/vm.test.ts
@@ -39,6 +39,14 @@ describe("Script", () => {
return script.runInThisContext(context);
});
});
+ test("can throw without new", () => {
+ // @ts-ignore
+ const result = () => Script();
+ expect(result).toThrow({
+ name: "TypeError",
+ message: "Class constructor Script cannot be invoked without 'new'",
+ });
+ });
});
function testRunInContext(