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.
Yes, IntelliJ Ultimate includes all WebStorm features. Most of them come as bundled plugins, but some features, e.g. Node. js support, are available as free plugins.
Who uses WebStorm? 1059 companies reportedly use WebStorm in their tech stacks, including Lyft, Tech Stack, and Accenture.
Chai is an assertion library that is mostly used alongside Mocha. It can be used both as a BDD / TDD assertion library for NodeJS and can be paired with any JavaScript testing framework. It has several interfaces that a developer can choose from and looks much like writing tests in English sentences.
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
".If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With