@WebStormIDE is a way to remove `Missing import statement` warnings from jest functions: expect and it, without writing own type file?
-
-
Replying to @bartsmykla
You can configure jest.d.ts as a WebStorm library (Preferences | Languages & Frameworks | JavaScript | Libraries - Download - search for Jest). That way these symbols will be resolved and inspection about imports will also go away.
1 reply 0 retweets 0 likes -
Replying to @WebStormIDE
I already did, and it's not working: http://d.pr/i/5g51BJ it's looking like webstorm is not resolving aliases ('it' as an aliast of 'test' etc.)
1 reply 0 retweets 0 likes -
Replying to @bartsmykla
Can you please send us a screenshot with the code and error message
1 reply 0 retweets 0 likes -
Replying to @WebStormIDE1 reply 0 retweets 0 likes
-
Replying to @bartsmykla
Thanks! But does it navigate to jest.d.ts when you cmd-click on it or expect? If you hit alt-enter, what imports it suggests for both symbols? At the moment as workaround would be to disable "Missing import" inspection in Preferences
1 reply 0 retweets 0 likes -
Replying to @WebStormIDE
You can create a scope for test files and disable the inspection only there if you want to keep it in all the other places.
2 replies 0 retweets 0 likes -
Replying to @WebStormIDE1 reply 0 retweets 0 likes
Thank you for the screenshots! We've fixed the problem in WebStorm 2018.1 and we've now checked that it also works fine with your setup. Meanwhile as a workaround please consider disabling the Missing import inspection.
-
-
Replying to @WebStormIDE
You can create a new scope that contains only test files and disable the inspection only in it.
0 replies 0 retweets 0 likesThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.