-
-
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
Change the way setting up the framework works #4976
Conversation
I don't think we can change this option right now, this is a major change to Jest that would break tons of users. We could introduce a new one and deprecate this one in Jest 22 though. |
Codecov Report
@@ Coverage Diff @@
## master #4976 +/- ##
==========================================
+ Coverage 60.21% 60.25% +0.04%
==========================================
Files 198 198
Lines 6620 6623 +3
Branches 4 4
==========================================
+ Hits 3986 3991 +5
+ Misses 2634 2632 -2
Continue to review full report at Codecov.
|
Ok, that's what I thought 🙂. I've added a new option, just for that use case. |
|
What about |
The intention of this feature, different from Ideally you can also change it to be an array, just like |
Ooh, I understand what you mean now. Yeah, my initial intention was to not use |
Updated; I made it an |
Alright, let's do it. I'm a bit uneasy about this hook as it breaks out of the sandboxing without being explicit but I guess it'll be fine. |
@@ -127,7 +127,9 @@ | |||
"transform": { | |||
"^.+\\.js$": "<rootDir>/packages/babel-jest" | |||
}, | |||
"setupTestFrameworkScriptFile": "<rootDir>/test_setup_file.js", |
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.
Whoops, this should stay where it was. #4994
@@ -72,7 +72,7 @@ export default ({ | |||
runTestsByPath: false, | |||
runner: 'jest-runner', | |||
setupFiles: ['<rootDir>/setup.js'], | |||
setupTestFrameworkScriptFile: '<rootDir>/test_setup_file.js', | |||
setupTestFramework: ['<rootDir>/test_setup_file.js'], |
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.
@SimenB I meant this line, sorry!
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. |
This is an RFC to modify how we evaluatesetupTestFrameworkScriptFile
. Instead of being required and injected inside the testing framework, it will be evaluated in the global context, and the child context will be passed as a parameter.I updated the PR to be a new option,
setupJasmine
, that will be run outside of the context, instead of inside.