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

Add support for AbortController in Jest Node environment with Node v15 #11182

Merged
merged 3 commits into from
Mar 11, 2021

Conversation

alehuo
Copy link
Contributor

@alehuo alehuo commented Mar 11, 2021

Summary

This PR adds support for the AbortController global when using the node Jest environment with Node v15.

The motivation for this pull request is to fix the error ReferenceError: AbortController is not defined when trying to test code that uses the AbortController in Node v15. This has previously been a Browser API but has now been introduced as a native API in Node v15.

Test plan

This change is non-breaking. Node versions earlier than v15 will behave the same as before, throwing a ReferenceError if you call AbortController without polyfilling it or using the jsdom environment.

@SimenB
Copy link
Member

SimenB commented Mar 11, 2021

This breaks the sandbox, but we already do it a bunch, so... I hope nodejs/node#28823 gets solved at some point.


Can you add a changelog entry?

@alehuo
Copy link
Contributor Author

alehuo commented Mar 11, 2021

I've now added a changelog entry, hope it's in the correct place 😄

@SimenB
Copy link
Member

SimenB commented Mar 11, 2021

I've now added a changelog entry, hope it's in the correct place 😄

it is 👍

Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

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

thanks!

@SimenB SimenB merged commit fee3c6a into jestjs:master Mar 11, 2021
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants