How to make angular run tests for only those files that have been modified?

时间:2019-03-06 11:42:23

标签: angular unit-testing

Basically, I would want ng test in watch mode to run corresponding tests for only those files that I modify and save.

I wouldn't want to use fdescribe or fit because this process is very manual and laborious and I'd have to change it back to describe and it after I'm done (to be noted, it still bloats the terminal with skipped statuses for all the skipped tests).

I am looking for something that I can pass as an argument to ng test which can then smartly detect file changes and run only their tests.

Thanks.

1 个答案:

答案 0 :(得分:0)

我认为您正在寻找:

角度版本: 8.2.0 Angular CLI版本: 8.3.14

  1. 您只能使用命令在分支中修改的那些文件运行测试

ng测试-只能更改

  1. 保存后,您可以观看文件并进行测试

ng test --only-changed --watch = true