Feature request or documentation missing?
I'd like to do
import {test, expect} from 'jest'
The current behaviour with globals works but it's just not convenient because IDEs don't recognize the functions.
Here are some stackoverflow related to this:
https://stackoverflow.com/questions/41324636/how-to-import-jest/43964557#43964557
https://stackoverflow.com/questions/41143700/how-to-import-describe-expect-and-it-into-a-typescript-tests-for-ide-to-n
@apflieger, I find that VSCode works fine if you install the Jest typings.
I couldn't find a way to make it work in IntelliJ
Duplicate of #4473
IDE compatibility is pretty good if you use typings from either flow or typescript
It's also not convenient because it breaks standardjs.
Of course, we can
it
and other functions in standard configimport { it } from global
But I like to think that, if a linter complies, it's because it's a bad practise. And indeed everything in global is a bad practise, at the root of some evils.
Mocha supports it. Any plan to add it ?
We have some vague plans to support it, but nothing concrete at this point. It is a feature we want, though 馃檪
This will be available in the next version of Jest via #9801.
Most helpful comment
We have some vague plans to support it, but nothing concrete at this point. It is a feature we want, though 馃檪