Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: native events #7

Merged
merged 2 commits into from
Mar 18, 2024
Merged

fix: native events #7

merged 2 commits into from
Mar 18, 2024

Conversation

kettanaito
Copy link
Member

@kettanaito kettanaito commented Mar 18, 2024

JSDOM is also known for re-implementing global Event, which breaks Node.js compatibility since contrived Event classes are not considered valid events in Node.js (see this).

  • Event
  • MessageEvent
  • EventTarget

@kettanaito kettanaito marked this pull request as draft March 18, 2024 12:40
@tobiashochguertel tobiashochguertel marked this pull request as ready for review March 18, 2024 12:43
@@ -10,6 +10,10 @@ class JSDOMEnvironmentExtended extends JSDOMEnvironment {
this.global.TextEncoder = TextEncoder
this.global.ReadableStream = ReadableStream

this.global.EventTarget = EventTarget
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will unblock the WebSocket support as well.

Copy link
Collaborator

@tobiashochguertel tobiashochguertel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@tobiashochguertel tobiashochguertel merged commit 1680d8a into main Mar 18, 2024
1 check passed
@tobiashochguertel tobiashochguertel deleted the fix/events branch March 18, 2024 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants