Running a single test file

后端 未结 10 589
囚心锁ツ
囚心锁ツ 2020-12-07 15:29

Is there a way to run ng test for a single file instead of for the entire test suite? Ideally, I\'d like to get the quickest possible feedback loop when I\'m e

10条回答
  •  清歌不尽
    2020-12-07 15:43

    This can be achieved these days via the include option. https://angular.io/cli/test#options

    It's a glob match, so as an example:

    ng test --include='**/someFolder/*.spec.ts'
    

    I can't find it in the 8.1.0 release notes, but @Swoox mentions below this is a feature after cli version 8.1.0. Thanks for figuring that out.

提交回复
热议问题