-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Bug: jest
errors with Class constructor Process cannot be invoked without 'new'
#23863
Labels
bug
Something isn't working correctly
node API polyfill
Related to various "node:*" modules APIs
node compat
Comments
bartlomieju
pushed a commit
that referenced
this issue
May 21, 2024
Popular test runners like Jest instantiate a new `Process` object themselves and expect the class constructor to be callable without the `new` keyword. This PR refactors our `Process` class implementation from a proper ES2015 class to an ES5-style class which can be invoked both with and without the `new` keyword like in Node. Fixes #23863
bartlomieju
pushed a commit
that referenced
this issue
May 21, 2024
Popular test runners like Jest instantiate a new `Process` object themselves and expect the class constructor to be callable without the `new` keyword. This PR refactors our `Process` class implementation from a proper ES2015 class to an ES5-style class which can be invoked both with and without the `new` keyword like in Node. Fixes #23863
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
Something isn't working correctly
node API polyfill
Related to various "node:*" modules APIs
node compat
Jest does some things with the
process
prototype that lead to an error:Excerpt of the code that throws this error:
The error is thrown because
process
isn't a class in Node whereas it is one in Deno.Steps to reproduce
Run this snippet:
Version: Deno 1.43.4
The text was updated successfully, but these errors were encountered: