How to specify test directory for mocha?

后端 未结 14 1611
走了就别回头了
走了就别回头了 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:12

    Run all files in test_directory including sub directories that match test.js

    find ./parent_test_directory -name '*test.js' | xargs mocha -R spec
    

    or use the --recursive switch

    mocha --recursive test_directory/
    

提交回复
热议问题