i'm trying learn testing , having lot of issues right now.
here basic component:
(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"; } }());
all trying in test make sure "test" equals "test", getting following error in console: undefined not 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"); }); });
can please me out?
it doesn't you're doing wrong there. here's jsbin (more or less) code: https://jsbin.com/cefefabobo/edit?html,js,output. test passes.
perhaps haven't loaded angular-mocks.js
script correctly?
Comments
Post a Comment