Angularjs 测试非常简单的角度控制器是否有意义?
这是我们的一个控制器。正如您所看到的,这是一个非常简单的控制器Angularjs 测试非常简单的角度控制器是否有意义?,angularjs,testing,Angularjs,Testing,这是我们的一个控制器。正如您所看到的,这是一个非常简单的控制器 angular. module("printing"). controller("PrintController", function PrintController( $window, localize, PartsEnum, IsBitIncluded ) { "use strict"; this.PartsEnum = ExamPartsEnum; this.IsBit
angular.
module("printing").
controller("PrintController", function PrintController(
$window,
localize,
PartsEnum,
IsBitIncluded
) {
"use strict";
this.PartsEnum = ExamPartsEnum;
this.IsBitIncluded = IsBitIncluded;
this.origin = $window.location.protocol + "//" + $window.location.host;
this.optionsText = [
localize.get("Yes"),
localize.get("Maybe"),
localize.get("No"),
];
});
- 我们应该为此控制器编写测试吗?如果你需要更多的信息来回答这个问题,那么写下的信息会左右你的答案
- 关于这个控制器,我们应该测试什么?它几乎什么也不做。有什么需要测试的
为了完整性/代码覆盖率,我还声明设置了其他两个属性。