-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add module.loaded
, and module.require
should not be enumerable
#4623
Conversation
0c98697
to
4e0bb4c
Compare
d7848d1
to
baadeae
Compare
@@ -29,13 +29,14 @@ import {run as cilRun} from './cli'; | |||
import {options as cliOptions} from './cli/args'; | |||
|
|||
type Module = {| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be type Module = typeof module
to get the type definitions from flow itself (it would have yelled at us for missing loaded
, for instance). A bit more work though as it also doesn't like that require
is added the way it is in this PR. Can revisit later
Codecov Report
@@ Coverage Diff @@
## master #4623 +/- ##
=========================================
+ Coverage 56.18% 56.2% +0.01%
=========================================
Files 194 194
Lines 6546 6548 +2
Branches 3 3
=========================================
+ Hits 3678 3680 +2
Misses 2867 2867
Partials 1 1
Continue to review full report at Codecov.
|
please rebase :) |
baadeae
to
ea071a3
Compare
ea071a3
to
32e302c
Compare
Rebased! |
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
As mentioned in #4614 (comment) there are 2 ways that
module
in normal node andmodule
in jest diverge (at the top level, #4614 addressesmodule.parent
being faked).module.require
should not be enumerable.module.loaded
is missing in jest's implementation. (https://nodejs.org/api/modules.html#modules_module_loaded)This PR fixes both of those issues.
Test plan
New test added