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
AngularJS:module.exports在karma测试中:模块未定义_Angularjs_Node.js_Jasmine_Protractor_Karma Runner - Fatal编程技术网

AngularJS:module.exports在karma测试中:模块未定义

AngularJS:module.exports在karma测试中:模块未定义,angularjs,node.js,jasmine,protractor,karma-runner,Angularjs,Node.js,Jasmine,Protractor,Karma Runner,我正试图编写一个外部模块,用module.exports为我的因果报应测试处理我的服务,但我一直在 未捕获引用错误:未定义模块 这是我的karma.conf.js文件: // Karma configuration // Generated on Fri Nov 07 2014 11:32:23 GMT-0600 (CST) module.exports = function(config) { config.set({ // base path that will be used to r

我正试图编写一个外部模块,用
module.exports
为我的因果报应测试处理我的服务,但我一直在

未捕获引用错误:未定义模块

这是我的karma.conf.js文件:

// Karma configuration
// Generated on Fri Nov 07 2014 11:32:23 GMT-0600 (CST)

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: [
  'bower_components/angular-mocks/angular-mocks.js',
  'tests/unit/*.js',
  'tests/unit/*.spec.js',
  'tests/unit/**/*.js'

],


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


// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
},


// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['progress'],


// web server port
port: 9876,


// enable / disable colors in the output (reporters and logs)
colors: true,


// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,


// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,


// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['Chrome'],


// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false
});
};
我的模块如下所示:

var devSrv = (function(){
    return{
       get: 'abc'
    }
}());
module.exports = devSrv;
作为旁注,我在使用量角器时也遇到了这个问题