-
-
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
Test environment gets current file path as option #7442
Conversation
Thank you for your pull request. We require contributors to sign our Contributor License Agreement, and yours has expired. Before we can review or merge your code, we need you to email [email protected] with your details so we can update your status. |
Not sure about the feature, but it should be passed in the constructor, not the individual methods |
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.
Still want to digest this, but I left a few comments in the mean time
packages/jest-runner/src/run_test.js
Outdated
const environment = new TestEnvironment(config, {console: testConsole}); | ||
const environment = new TestEnvironment(config, { | ||
console: testConsole, | ||
testPath: 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.
Can you think of anything else we should expose here while we're thinking about it?
69bcc05
to
92f0050
Compare
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
We're getting a flow error, mind taking a look at it? Run |
40d4a83
to
7c18f46
Compare
Rebased and fixed Flow error. |
Codecov Report
@@ Coverage Diff @@
## master #7442 +/- ##
==========================================
- Coverage 67.46% 67.44% -0.02%
==========================================
Files 247 247
Lines 9516 9511 -5
Branches 5 5
==========================================
- Hits 6420 6415 -5
Misses 3094 3094
Partials 2 2
Continue to review full report at Codecov.
|
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
The
testEnvironment
feature enables a whole new suite of tests to be written with Jest.However the following use case can present itself:
setupFiles
is less than optimal, as we would pay the price for this task on each test filePS: Related #6889
Test plan