You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/wpt/harness/globals.ts
+9Lines changed: 9 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -29,6 +29,15 @@ import { getBindingPath } from './common';
29
29
// @ts-expect-error We're just exposing enough stuff for the tests to pass; it's not a perfect match
30
30
globalThis.self=globalThis;
31
31
32
+
// WPT tests use self.URL which requires URL to be an own property of globalThis
33
+
globalThis.URL=URL;
34
+
35
+
// Some WPT tests reference addEventListener at the top level during file evaluation.
36
+
// workerd doesn't have addEventListener on the global (it uses module exports instead),
37
+
// so we provide a no-op stub to allow test files to load without throwing.
38
+
// Tests that actually need addEventListener functionality should be marked as omitted.
39
+
globalThis.addEventListener=(): void=>{};
40
+
32
41
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access -- We're just exposing enough stuff for the tests to pass; it's not a perfect match
0 commit comments