I spent some time recently working on a new nodejs module (meta-confirm) and wanted to share a few bits of information I learned in the process as a result of hours of searching and experimentation.
I'm just giving back to the community for the next person who is struggling to find a quick, easy answer to this situation.
The problem: While creating a test using chai assertions, you get the message "Undefined function or method x() ". In this example: " Undefined function or method contain()".
To fix this code completion warning in Webstorm 10....
- Change the drop selection from Official Libraries to Typescript Community Stubs
- Find chai and select Download and Install
- Enable chai-DefinitelyTyped
- Now, your code checking in Webstorm will recognize the syntax of the chai expectation library.
Notice that the .contain no longer shows as an undefined function or method warning.
Passionate About Agile
chai assertion library
chai TypeScript community stub
WebStorm from JetBrains