diff options
author | cjihrig <cjihrig@gmail.com> | 2022-05-11 21:15:54 -0400 |
---|---|---|
committer | Colin Ihrig <cjihrig@gmail.com> | 2022-06-16 12:05:33 -0400 |
commit | 95312ab53a3a118955278a27a0297a17889ad36e (patch) | |
tree | 287be428d28e3477380813c9849d36f0f0502569 /cli/tests/unit/performance_test.ts | |
parent | 364da468d24653b00c9989187f3d45609f007265 (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.ts | 13 |
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")); + }); +}); |