Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/21.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
';因果报应';茉莉花&x27;模块未定义[AngularJs测试]_Angularjs_Unit Testing_Karma Jasmine - Fatal编程技术网

';因果报应';茉莉花&x27;模块未定义[AngularJs测试]

';因果报应';茉莉花&x27;模块未定义[AngularJs测试],angularjs,unit-testing,karma-jasmine,Angularjs,Unit Testing,Karma Jasmine,我搜索了所有关于SO的帖子来寻找这个话题,但没有一个能解决我的问题。我试图测试我的过滤器,但我得到一个错误,模块没有定义。我包括了我的角度模拟文件I karma config,并且我有正确的顺序。有人能从我下面的代码中看到这种行为的原因吗 测试 describe('filter', function() { beforeEach(angular.mock.module('myApp')); describe('reverse', function () { it('should re

我搜索了所有关于SO的帖子来寻找这个话题,但没有一个能解决我的问题。我试图测试我的过滤器,但我得到一个错误,模块没有定义。我包括了我的角度模拟文件I karma config,并且我有正确的顺序。有人能从我下面的代码中看到这种行为的原因吗

测试

describe('filter', function() {

beforeEach(angular.mock.module('myApp'));

 describe('reverse', function () {
   it('should reverse string', inject(function (reverse) {
       expect(reverse("ABC")).toEqual('BCA');
      }))
      })
     });
Karma.config

// Karma configuration


  module.exports = function(config) {
   config.set({

    // base path that will be used to resolve all patterns (eg. files,   exclude)
    basePath: '',


   // frameworks to use
  // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
    frameworks: ['jasmine'],


   // list of files / patterns to load in the browser
    files: [
    'app/js/vendor/angular.min.js',
    'app/js/vendor/angular-mock.js',
    'app/js/angular.module.js',
    'app/js/angular.module.spec.js'
     ],


// list of files to exclude
exclude: [
],

 }