Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 在Jasmine中加载具有依赖项的模块_Javascript_Angularjs_Jasmine - Fatal编程技术网

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语法。我将就此提出一个新问题