Reputation: 9464
I am using Mocha+Chai for a current Node.js project. My IDE is Webstorm 11.
Unfortunately, it seems Webstorm has no way of figuring out how language chains in Chai's should/expect are supposed to work. The following is commonplace:
I have tried explicitly setting both Chai
and Chai-DefinetlyTyped
as libraries for my project via Settings->Javascript->Libraries
, but this does not resolve anything.
For the sake of tool support, I have considered dropping expect/should for assert instead, as this works perfectly. However, I very much prefer the style of expect/should, so it would be amazing to see a solution to this.
Upvotes: 18
Views: 4095
Reputation: 93748
Problem is caused by weird dynamic way these chains are defined. As a workaround I can suggest using chai.d.ts:
Settings | Languages & Frameworks | JavaScript | Libraries
"Download...
" button and select "TypeScript community stubs"Download and Install
".Upvotes: 44