WebStorm not recognising Mocha describe() and it()

<>

This question already has an answer here:

Answers


From the description of the inspection:

When using libraries that define their own global symbols outside their visible JavaScript code (e.g. describe() in Mocha), it is recommended that you add the corresponding TypeScript type definition file as a JavaScript library in Preferences | Languages & Frameworks | JavaScript | Libraries.

Navigate to the above referenced preference and make sure the @types/mocha (this was changed in early 2019 from mocha-DefinitelyTyped. Either is OK.) library is in the list (don't select it). If it is not in the list, click the Download... button, find mocha there, and add it. Then click the Manage Scopes... button, find your test directory, click on the library column, and select the @types/mocha entry. See the screenshot below.


This answer might help you: Mocha's describe "require() is missing" in WebStorm 11. It explains how to disable specific inspections for specific folders, which can be useful when working with Mocha. So it is a different approach to installing the mocha-definatelyTyped library.


Need Your Help

changing maxLength property for password input not working

javascript html input dojo passwords

I have a password input control and by default, the component that creates the password control sets a maxLength of 32. I am trying to change the maxLength of the password input to 128 characters u...