[英]Force Karma to take updated spec.js file from disk
我正在為角度控制器編寫測試規范,這樣說:
it('should have a method to add a blank category', function () {
var controller = CategoryControllerCreator();
$scope.allcategories = {};
$scope.addCategoryStart();
expect($scope.allcategories["ID-1"]).not.toBeUndefined();
});
然后,我需要對其進行測試以查看其是否有效。 所以我跑:
karma start
在命令窗口中。 很快我意識到我需要使用scope
而不是$scope
,所以我在Karma窗口中保存了spec.js
文件CTRL + C
,重新打開瀏覽器,按debug並再試一次。 當我編寫測試規范時,這種情況一直持續下去。
我可以強迫Karma只從磁盤上獲取最新的spec.js
文件,而不必讓我重復此過程嗎?
在運行時使用自動監視開關:
--autoWatch
並且您還可以告訴它在使用autoWatchBatchDelay運行之前,要等待一定的時間:
autoWatchBatchDelay:500
全部位於配置選項中: http : //karma-runner.github.io/0.13/config/configuration-file.html
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.