summaryrefslogtreecommitdiff
path: root/cli/tests/unit
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/unit')
-rw-r--r--cli/tests/unit/performance_test.ts17
-rw-r--r--cli/tests/unit/permissions_test.ts14
2 files changed, 30 insertions, 1 deletions
diff --git a/cli/tests/unit/performance_test.ts b/cli/tests/unit/performance_test.ts
index 3c98e4e40..7b2fa5cef 100644
--- a/cli/tests/unit/performance_test.ts
+++ b/cli/tests/unit/performance_test.ts
@@ -3,6 +3,7 @@ import {
unitTest,
assert,
assertEquals,
+ assertThrows,
createResolvable,
} from "./test_util.ts";
@@ -64,3 +65,19 @@ unitTest(function performanceMeasure() {
}, 100);
});
});
+
+unitTest(function performanceIllegalConstructor() {
+ assertThrows(() => new Performance(), TypeError, "Illegal constructor.");
+});
+
+unitTest(function performanceEntryIllegalConstructor() {
+ assertThrows(() => new PerformanceEntry(), TypeError, "Illegal constructor.");
+});
+
+unitTest(function performanceMeasureIllegalConstructor() {
+ assertThrows(
+ () => new PerformanceMeasure(),
+ TypeError,
+ "Illegal constructor.",
+ );
+});
diff --git a/cli/tests/unit/permissions_test.ts b/cli/tests/unit/permissions_test.ts
index 005727721..21fa1d27b 100644
--- a/cli/tests/unit/permissions_test.ts
+++ b/cli/tests/unit/permissions_test.ts
@@ -1,5 +1,5 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
-import { unitTest, assertThrowsAsync } from "./test_util.ts";
+import { unitTest, assertThrows, assertThrowsAsync } from "./test_util.ts";
unitTest(async function permissionInvalidName(): Promise<void> {
await assertThrowsAsync(async () => {
@@ -13,3 +13,15 @@ unitTest(async function permissionNetInvalidUrl(): Promise<void> {
await Deno.permissions.query({ name: "net", url: ":" });
}, URIError);
});
+
+unitTest(function permissionsIllegalConstructor() {
+ assertThrows(() => new Deno.Permissions(), TypeError, "Illegal constructor.");
+});
+
+unitTest(function permissionStatusIllegalConstructor() {
+ assertThrows(
+ () => new Deno.PermissionStatus(),
+ TypeError,
+ "Illegal constructor.",
+ );
+});