【发布时间】:2014-03-14 04:29:58
【问题描述】:
我正在检查我的模块中是否存在PracticeCtrl。我为此编写了以下测试。
给我错误:ReferenceError: myApp is not defined
describe('myApp', function() {
describe('Controller: PracticeCtrl', function () {
// load the controller's module
beforeEach(function () {
// Load the controller's module
module('myApp');
});
it('should have a PracticeCtrl controller', function() {
expect(myApp.PracticeCtrl).toBeDefined();
});
});
});
如何检查我的模块是否存在控制器?由于我是新手,因此对语法了解较少。
【问题讨论】:
标签: node.js angularjs unit-testing testing