karma单元测试运行问题错误$ injector:modulerr无法实例化模块

时间:2017-07-12 18:56:07

标签: angularjs unit-testing karma-runner karma-jasmine

我是angularJS单元测试的新手,我添加了一个新的单元测试,但我遇到了这个问题:

Error: [$injector:modulerr] Failed to instantiate module FeeBuddy due to:
Error: [$injector:modulerr] Failed to instantiate module ngMaterial due to:
Error: [$injector:nomod] Module 'ngMaterial' 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.

这是我的karma.conf.js文件dependecies调用:

files: [
      'node_modules/angular/angular.js',
      'node_modules/angular-mocks/angular-mocks.js',
      'node_modules/angular-ui-router/release/angular-ui-router.js',
      //'node_modules/angular-material/angular-material.js',
      'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.js',
      'public/js/vendor/materialPreloader.min.js',
      'js/server.config.js',
      'js/main.controller.js',
      'js/controllers/*.js',
      'js/services/*.js',
      'js/directives/*.js',
      'js/factories/*.js',
      'js/components/*.js',
      'js/modules/**/*.js',
      'js/routes.js',
      'js/modules.js',
      'js/module.js',
      'js/filters/*.js',
      'js/modules/**/module.js',
      'js/dependecies.js',
      'test/unit/*.js'
    ],

即使我取消注释node_modules/angular-material/angular-material.js仍然有同样的问题

0 个答案:

没有答案