-
-
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
new jest globals #1632
new jest globals #1632
Conversation
that is a ton of new globals. |
worth it! still, i think the ideal solution would be to enable {
globals: false
} in the config and then import {it, describe} from 'jest'; |
but we can't actually shadow jest with our own module because how are you gonna require jest in a jest test then? |
90fe16e
to
8b3f900
Compare
https://github.com/facebook/jest/blob/master/packages/jest/src/jest.js i think we can actually export it here instead of proxying do we have anything that uses |
I mean, we can probably survive. tbh I kind of want to keep the globals. I'm not happy with the one-line boilerplate in every test… |
Current coverage is 89.93% (diff: 100%)@@ master #1632 diff @@
==========================================
Files 31 31
Lines 1143 1143
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
Hits 1028 1028
Misses 115 115
Partials 0 0
|
Reeeally hoping this'll land :) |
@@ -0,0 +1,22 @@ | |||
exports[`test global jest variables 1`] = ` |
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 IS SOOOOO COOOOL!
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 is actually an awesome use of snapshot testing!
I feel like context is a very common variable name as opposed to |
Personally, I never use |
yeah. let's kill context. its semantics is hard to understand too |
44941c2
to
551ac8e
Compare
A pull request should probably be opened to add |
@DmitriiAbramov is way ahead of you: sindresorhus/globals#97 |
@DmitriiAbramov ruby will never go out from your blood hahah |
@DmitriiAbramov are you going to add them to the documentation? Otherwise it's a pretty undiscoverable feature. http://facebook.github.io/jest/docs/api.html#the-jest-global-environment |
@vjeux yes! i'll submit a PR with the docs a bit later :) |
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. |
added some globals that i always wanted.
we also need to add them to all the lint rules