Mocha's describe “require() is missing” in WebStorm 11

前端 未结 5 1340
故里飘歌
故里飘歌 2020-12-23 20:27

I\'ve just installed WebStorm 11 and created a new project, however WebStorm is saying that a require() is needed for the describe method:

5条回答
  •  天涯浪人
    2020-12-23 21:09

    There is very simple workaround that will solve the issue for you and for all other developers in the project:

    Add the following line at the top of the file:

    const { describe, it, before, beforeEach, afterEach, after } = require('mocha');
    

提交回复
热议问题