How do you install and run Mocha, the Node.js testing module? Getting “mocha: command not found” after install

前端 未结 5 976
暖寄归人
暖寄归人 2020-12-07 11:40

I\'m having trouble getting Mocha to work as expected, and I\'d love to say as documented, but there (appears) to not be much documentation on actually getting the thing run

5条回答
  •  不知归路
    2020-12-07 11:59

    For windows :

    Package.json

      "scripts": {
        "start": "nodemon app.js",
        "test": "mocha"
      },
    

    then run the command

    npm run test
    

提交回复
热议问题