Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/433.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/27.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
Javascript 使用PhantomJS而不是Chrome时,Karma会失败_Javascript_Reactjs_Phantomjs_Karma Runner_Browserify - Fatal编程技术网

Javascript 使用PhantomJS而不是Chrome时,Karma会失败

Javascript 使用PhantomJS而不是Chrome时,Karma会失败,javascript,reactjs,phantomjs,karma-runner,browserify,Javascript,Reactjs,Phantomjs,Karma Runner,Browserify,我使用Karma Chrome启动器时通过了一系列测试,但使用Karma PhantomJS启动器时失败 这是我的karma.config.js文件中的内容 ``` 框架:['browserify'、'mocha'、'chai'、'sinon'] files: require('./include.conf.js').concat([ 'test/helper/*.js', 'test/example/*.spec.js', 'test/unit/*.spec.js', 'tes

我使用Karma Chrome启动器时通过了一系列测试,但使用Karma PhantomJS启动器时失败

这是我的karma.config.js文件中的内容 ``` 框架:['browserify'、'mocha'、'chai'、'sinon']

files: require('./include.conf.js').concat([
  'test/helper/*.js',
  'test/example/*.spec.js',
  'test/unit/*.spec.js',
  'test/integration/*.spec.js'
]),


// list of files to exclude
exclude: [
  'gulpfile.js',
  'index.js',
  'karma.conf.js'
],

browserify: {
    debug: true,
    transform: ['reactify'],
    bundleDelay: 1000
},

preprocessors: {
    'test/helper/*.js': ['browserify'],
    'test/example/*.spec.js': ['browserify'],
    'test/unit/*.spec.js': ['browserify'],
    'test/integration/*.spec.js': ['browserify'],
    'dev/js/**/*.js': ['browserify']
},

// web server port
port: 9876,

autoWatch: true,

browsers: ['PhantomJS'],

// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: true,

plugins: [
    'karma-coverage',
    'karma-mocha',
    'karma-browserify',
    'karma-chai',
    'karma-sinon',
    'karma-phantomjs-launcher'
]```
所有文件都在使用Karma Chrome Launcher进行预处理并正常运行,但当我尝试使用PhantomJS运行它们时,会出现如下错误:

PhantomJS 1.9.8(Mac OS X 0.0.0)错误 ReferenceError:找不到变量:require at/Users/edwinlin/Documents/repos/Picarus/dev/js/utils/database-utils.js:1

谢谢任何人的帮助