Testing 摩卡挂钩突然不执行(在任何测试中)

Testing 摩卡挂钩突然不执行(在任何测试中),testing,express,mocha.js,Testing,Express,Mocha.js,我和Mocha一起在Express中测试API。事情按预期进行,但在几个小时前,突然没有测试运行。自从一切正常以来,我没有做任何改变,除了测试本身,所以我不确定交易是什么。我甚至试着把所有的东西都扔掉,所以现在我要做的就是: describe('make a test run', function(){ console.log('entered test'); before( function(){ console.log('before'); }); it('

我和Mocha一起在Express中测试API。事情按预期进行,但在几个小时前,突然没有测试运行。自从一切正常以来,我没有做任何改变,除了测试本身,所以我不确定交易是什么。我甚至试着把所有的东西都扔掉,所以现在我要做的就是:

describe('make a test run', function(){

  console.log('entered test');

  before( function(){ 
    console.log('before'); 
  });

  it('test 1', function(){ 
    console.log('1'); 
  });
  it('test 2', function(){
   console.log('2'); 
  });
  it('test 2', function(){ 
    console.log('2'); 
  });

  after( function(){ 
    console.log('after'); 
  });

  console.log('ran through test');

});

它将打印已输入的测试和已运行的测试,但中间不会打印任何内容。我到底错了什么?

我无法重现您报告的问题。我将上面的代码剪切并粘贴到一个名为test.js的文件中,然后在命令行运行mocha。我从所有控制台语句和Mocha报告的所有其他内容中获得输出,包括3个测试通过。您确定运行Mocha时没有跳过所有测试的选项,例如-grep asdfasd,它与您的所有测试都不匹配吗?检查你的摩卡咖啡。如果你创建了一个,也可以选择。回来有点晚-谢谢你的回复!我记不清到底是什么问题,但我认为这确实是一个选择问题。