Javascript 在Jasmine中加载具有依赖项的模块
我有一个模块定义如下:Javascript 在Jasmine中加载具有依赖项的模块,javascript,angularjs,jasmine,Javascript,Angularjs,Jasmine,我有一个模块定义如下: var angular_multi_select_engine = angular.module('angular-multi-select-engine', [ 'angular-multi-select-constants' ]); 如您所见,引擎取决于常量模块 我正在尝试在引擎上运行一些测试,测试内容如下: beforeEach(function() { angular.mock.module('angular-multi-select-engin
var angular_multi_select_engine = angular.module('angular-multi-select-engine', [
'angular-multi-select-constants'
]);
如您所见,引擎取决于常量
模块
我正在尝试在引擎上运行一些测试,测试内容如下:
beforeEach(function() {
angular.mock.module('angular-multi-select-engine', 'angular-multi-select-constants');
});
但当我试着运行jasmine时,它说:
Error: [$injector:modulerr] Failed to instantiate module angular-multi-select-engine due to:
[$injector:nomod] Module 'angular-multi-select-engine' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
如果我尝试只加载常量
模块,Jasmine将按预期工作,我可以测试常量
模块的值
如何加载具有依赖项的模块?事实证明,Jasmine没有加载引擎
模块,因为我使用了ES6语法。我将就此提出一个新问题