How to specify test directory for mocha?

后端 未结 14 1677
走了就别回头了
走了就别回头了 2020-12-04 05:59

Mocha tries to find test files under test by default, how do I specify another dir, e.g. server-test?

14条回答
  •  被撕碎了的回忆
    2020-12-04 06:19

    I had this problem just now and solved it by removing the --recursive option (which I had set) and using the same structure suggested above:

    mochify "test/unit/**/*.js"

    This ran all tests in all directories under /test/unit/ for me while ignoring the other directories within /test/

提交回复
热议问题