我用karma运行我的角度测试,我的应用程序在浏览器中正常运行,但测试失败,我怀疑设置错误.
以下是控制器和测试:
// app/scripts/controllers/main.js
'use strict';
angular.module('GloubiBoulgaClientApp')
.controller('MainCtrl', function ($scope) {
});
Run Code Online (Sandbox Code Playgroud)
这是测试文件:
'use strict';
describe('Controller: MainCtrl', function () {
// load the controller's module
beforeEach(module('GloubiBoulgaClientApp'));
var MainCtrl,
scope;
// Initialize the controller and a mock scope
beforeEach(inject(function ($controller, $rootScope) {
scope = $rootScope.$new();
MainCtrl = $controller('MainCtrl', {
$scope: scope
});
}));
it('should attach a list of awesomeThings to the scope', function () {
expect(true).toBe(true);
});
});
Run Code Online (Sandbox Code Playgroud)
因果报应
module.exports = function(config) {
config.set({
// base path, that will be used …Run Code Online (Sandbox Code Playgroud)