-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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: expose vm context directly from test envs #9428
Conversation
e2ab86d
to
0f52b41
Compare
Codecov Report
@@ Coverage Diff @@
## master #9428 +/- ##
==========================================
- Coverage 65.04% 65.03% -0.02%
==========================================
Files 283 283
Lines 12088 12093 +5
Branches 2983 2984 +1
==========================================
+ Hits 7863 7865 +2
- Misses 3589 3591 +2
- Partials 636 637 +1
Continue to review full report at Codecov.
|
#9431 (comment) ditto |
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. |
Summary
I've been looking into ES Modules and what it'd take, and one thing is passing in a
context
when constructing it (see https://nodejs.org/api/vm.html#vm_class_vm_module). Since I've just addedcompileFunction
next torunScript
adding yet another function seemed silly. So I've removedcompileFunction
(never released anyways) and added a method which exposes the rawvm.Context
. This matches what JSDOM has done (which I suppose is the motivation for the originalrunScript
implementation - JSDOM previously only hadrunVMScript()
), see jsdom/jsdom#2768. Note that we cannot upgrade to JSDOM@16 yet since they've dropped support for Node 8. I've created https://www.npmjs.com/package/jest-environment-jsdom-sixteen though (which currently hascompileFunction
- I'll change togetVmContext
shortly).Relates to #9252.
Test plan
Green CI