I have a series of tests that pass when I use the Karma Chrome Launcher, but fail when I use the Karma PhantomJS launcher.
Here is my what's inside my karma.config.js file `` '' frames: ['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'
]),
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']
},
port: 9876,
autoWatch: true,
browsers: ['PhantomJS'],
singleRun: true,
plugins: [
'karma-coverage',
'karma-mocha',
'karma-browserify',
'karma-chai',
'karma-sinon',
'karma-phantomjs-launcher'
]```
All files are pre-processed and work correctly using Karma Chrome Launcher, but when I try to start them using PhantomJS, I get a bunch of errors like this:
PhantomJS 1.9.8 (Mac OS X 0.0.0) ERROR ReferenceError: Cannot find variable: require in / Users / edwinlin / Documents / repos / Picarus / dev / js / utils / database -utils.js: 1
Thanks for the help!