ReferenceError: describe is not defined NodeJs

后端 未结 6 1034
耶瑟儿~
耶瑟儿~ 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:20

    OP asked about running from node not from mocha. This is a very common use case, see Using Mocha Programatically

    This is what injected describe and it into my tests.

    mocha.ui('bdd').run(function (failures) {
        process.on('exit', function () {
          process.exit(failures);
        });
      });
    

    I tried tdd like in the docs, but that didn't work, bdd worked though.

提交回复
热议问题