Chutzpah 无法找到导入的 angular 库模块

Chutzpah unable to find imported angular library module

我最近将这个 angular 库带到了我的项目中:

https://github.com/a5hik/angular-multi-select-tree

除了我的单元测试之外,一切都很好。 运行 我的测试出现此错误:

Module 'multi-select-tree' 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.

这让我感到困惑,因为我已将它添加到我的 chutzpah.json 参考文献中(并多次确认路径正确),如下所示:

{ "Path": "../Scripts/Lib/ng-multi-select-tree/ng-multi-select-tree.js" },
{ "Path": "../Scripts/Lib/ng-multi-select-tree/ng-multi-select-tree.tpl.js" },

并将其包含在我的 app.js 主文件中。注释掉的代码允许 Chutzpah 找到库,但这会破坏它的所有功能:

// work around for Chutzpah test discovery
//angular.module('multi-select-tree', []);
var authoring = angular.module('authoring', ['ms-content', 'portalCommon', 'ngFileUpload', 'ckeditor', 'ui.bootstrap', 'AdalAngular', 'ui.sortable', 'nvd3', 'multi-select-tree']).run(['$rootScope', function ($rootScope) {}]);

我注意到的是这个库是如何像这样实例化模块的:

(function () {
    'use strict';
    var mainModule = angular.module('multi-select-tree');

他们似乎实例化模块,然后将其设置为变量。我的同事暗示这可能是问题所在。关于为什么 Chutzpah 很难找到这个特定模块有什么想法吗?

这最终与我的模块的初始化方式无关。事实证明,Chutzpah 确实喜欢 lambdas ('=>')。