ReferenceError: describe is not defined NodeJs

后端 未结 6 1023
耶瑟儿~
耶瑟儿~ 2020-11-29 20:52

I am trying to define some endpoints and do a test using nodejs. In server.js I have:

var express = require(\'express\');
var func1         


        
6条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-29 21:22

    Assuming you are testing via mocha, you have to run your tests using the mocha command instead of the node executable.

    So if you haven't already, make sure you do npm install mocha -g. Then just run mocha in your project's root directory.

提交回复
热议问题