-
-
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
chore: move execution of setupFiles
to jest-runner
#9596
Conversation
@@ -163,6 +163,8 @@ async function runTestInternal( | |||
|
|||
const start = Date.now(); | |||
|
|||
config.setupFiles.forEach(path => runtime!.requireModule(path)); |
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.
I do this up here since it happened in the constructor previously. However, I wonder if it makes more sense to do it after we call the environment's setup
function further down? If not, maybe right before? Seems like they belong together
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.
We can mark it as a todo for later, to group similar features together. However for now, to avoid unintended breakages, I'd stay with what's closer to previous version
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.
yeah, makes sense
import setGlobal from './setGlobal'; | ||
import deepCyclicCopy from './deepCyclicCopy'; | ||
import convertDescriptorToString from './convertDescriptorToString'; | ||
export {default as clearLine} from './clearLine'; |
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.
snuck this in
Codecov Report
@@ Coverage Diff @@
## master #9596 +/- ##
=========================================
+ Coverage 65.08% 65.1% +0.01%
=========================================
Files 286 286
Lines 12144 12141 -3
Branches 3008 3007 -1
=========================================
Hits 7904 7904
+ Misses 3605 3603 -2
+ Partials 635 634 -1
Continue to review full report at Codecov.
|
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 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
Since ESM is asynchronous we cannot run this as part of
jest-runtime
's constructor.This is technically a breaking change, but I'd be hugely surprised if someone either uses a custom runtime or uses
jest-runtime
directly. Can hold off on merging until Jest 26 changes start landing, but that'll make it impossible to land any kind of support for ESM insetupFiles
. Maybe not a biggie 🙂Test plan
Green CI