1
테스트를 배우려고하고 있으며 많은 문제가 있습니다. 여기 각도 1.5 구성 요소를 테스트하는 데 문제가 있습니다.
내 아주 기본적인 구성 요소입니다(function() {
"use strict";
angular.module("testList", [])
.component("testList", {
templateUrl: "test-list.component.html",
controllerAs: "model",
controller: testController
});
function testController() {
var model = this;
model.test = "test";
}
}());
내 테스트에서 할 노력하고 모든 "테스트", "테스트"에 해당 있는지 확인하는 것입니다,하지만 난 내 콘솔에 다음과 같은 오류를 얻고있다 : undefined is not a function
"use strict";
describe("Testing Component", function() {
var $componentController;
beforeEach(module('testList'));
beforeEach(inject(function(_$componentController_) {
$componentController = _$componentController_;
}));
it("should see if test equals test", function() {
var ctrl = $componentController('testList', null, { test: "test"});
expect(ctrl.test).toEqual("test");
});
});
누군가 나를 도울 수 있습니까?