代码之家  ›  专栏  ›  技术社区  ›  TrongBang

Mocha未在子文件夹中加载测试

  •  1
  • TrongBang  · 技术社区  · 8 年前

    我的包中有这个命令。json:

    NODE_PATH=$NODE_PATH:$PWD/frontend mocha --compilers js:babel-register --require ./frontend/test/helpers.js --recursive frontend/test/**/*.js
    

    我可以将文件放在frontend/test/public/file1下。js和frontend/test/private/file2。js正在工作。但是当我创建子文件夹时,例如frontend/test/public/ 食物 /food_测试。js或前端/测试/专用/ /panel_测试。js,摩卡没有运行它们。

    1 回复  |  直到 8 年前
        1
  •  0
  •   TrongBang    8 年前

    答案是删除 **/*.js . 命令如下:

    NODE_PATH=$NODE_PATH:$PWD/frontend mocha --compilers js:babel-register --require ./frontend/test/helpers.js --recursive frontend/test