summaryrefslogtreecommitdiff
path: root/cli/tests/unit/performance_test.ts
diff options
context:
space:
mode:
authorcjihrig <cjihrig@gmail.com>2022-05-11 21:15:54 -0400
committerColin Ihrig <cjihrig@gmail.com>2022-06-16 12:05:33 -0400
commit95312ab53a3a118955278a27a0297a17889ad36e (patch)
tree287be428d28e3477380813c9849d36f0f0502569 /cli/tests/unit/performance_test.ts
parent364da468d24653b00c9989187f3d45609f007265 (diff)
fix: make Performance global an EventTarget
This commit updates the Performance global to extend EventTarget.
Diffstat (limited to 'cli/tests/unit/performance_test.ts')
-rw-r--r--cli/tests/unit/performance_test.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/cli/tests/unit/performance_test.ts b/cli/tests/unit/performance_test.ts
index 917546e2c..687bb024d 100644
--- a/cli/tests/unit/performance_test.ts
+++ b/cli/tests/unit/performance_test.ts
@@ -140,3 +140,16 @@ Deno.test(function performanceMeasureIllegalConstructor() {
"Illegal constructor",
);
});
+
+Deno.test(function performanceIsEventTarget() {
+ assert(performance instanceof EventTarget);
+
+ return new Promise((resolve) => {
+ const handler = () => {
+ resolve();
+ };
+
+ performance.addEventListener("test", handler, { once: true });
+ performance.dispatchEvent(new Event("test"));
+ });
+});