summaryrefslogtreecommitdiff
path: root/cli/tests/unit/performance_test.ts
diff options
context:
space:
mode:
authorNayeem Rahman <nayeemrmn99@gmail.com>2020-09-19 22:30:59 +0100
committerGitHub <noreply@github.com>2020-09-19 23:30:59 +0200
commitaaa5e6613a739f8e2ff7579b69c2504bcdc37d4f (patch)
treed6c198b5bc222be4c097e7aa5e9504662c98a974 /cli/tests/unit/performance_test.ts
parent79e5b57663becad3614bce98e31c7d1d494cb50d (diff)
fix(cli/rt): make some web API constructors illegal at runtime (#7468)
Diffstat (limited to 'cli/tests/unit/performance_test.ts')
-rw-r--r--cli/tests/unit/performance_test.ts17
1 files changed, 17 insertions, 0 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.",
+ );
+});