Javascript 角度+;Karma/Jasmine:错误:[$injector:nomod]模块';md.data.table';不可用
我正在使用Karma和Jasmine来测试我的角度应用程序 我的规格如下:Javascript 角度+;Karma/Jasmine:错误:[$injector:nomod]模块';md.data.table';不可用,javascript,angularjs,jasmine,karma-runner,Javascript,Angularjs,Jasmine,Karma Runner,我正在使用Karma和Jasmine来测试我的角度应用程序 我的规格如下: "use strict"; describe("SuperHeroService", function () { var SuperHeroService, $httpBackend; beforeEach(module('beAwesome')); beforeEach(module("beASuperHero")); beforeEach(function () {
"use strict";
describe("SuperHeroService", function () {
var SuperHeroService, $httpBackend;
beforeEach(module('beAwesome'));
beforeEach(module("beASuperHero"));
beforeEach(function () {
inject(function (_SuperHeroService_, _$httpBackend_) {
SuperHeroService = _SuperHeroService_;
$httpBackend = _$httpBackend_;
});
});
it("should initialize correctly", function () {
expect(SuperHeroService).toBeDefined();
});
md.data.table
依赖项包含在beAwesome模块中,我将其包含在beforeach块中。beAwesome模块在beASuperHero中也被调用
我还在karma.conf文件中引用了超级英雄服务beAwesome和beASuperHero
但是,我无法理解为什么md数据表(Github项目:)不会被实例化并不断中断,无论我做什么:
Error: [$injector:modulerr] Failed to instantiate module beASuperHero due to:
Error: [$injector:modulerr] Failed to instantiate module md.data.table due to:
Error: [$injector:nomod] Module 'md.data.table' 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.
我肯定我只是缺少一些配置或一行代码,但经过数小时的搜索,我还没有找到任何有用的东西!我们非常感谢您给我们任何脱钩的提示
谢谢您是否已将
md.data.table
模块定义在您的Karma配置的文件
数组中的文件包括在内?此外,正确的模块名称似乎是mdDataTable
,不是md.data.table
如果你的'md.data.table'
模块中有'beasuphero'
依赖项,那么你完全不能假设你的应用程序真的可以工作,你应该重新查看我的第一条评论~在文件数组中包含定义'md.data.table'
模块的文件。仅供参考,它不是bower_components/md data table/dist/md data table.js
?如果是,路径是bower_组件/角度材料数据表/dist/md数据表.js