I wrote a node module that can be used for both the backend and the client
(exports || window).Bar= (function () { return function () { .... } })();
Now my karma tests use PhantomJs and complain about the nonexistent export variable
gulp.task('test', function () { var karma = require('karma').server; karma.start({ autoWatch: false, browsers: [ 'PhantomJS' ], coverageReporter: { type: 'lcovonly' }, frameworks: [ 'jasmine' ], files: [ 'bar.js', 'tests/bar.spec.js' ], junitReporter: { outputFile: 'target/junit.xml' }, preprocessors: { 'app/js/!(lib)/**/*.js': 'coverage' }, reporters: [ 'progress', 'junit', 'coverage' ], singleRun: true }); });
The error I get is
PhantomJS 1.9.7 (Mac OS X) ERROR ReferenceError: Can't find variable: exports
Is there a way to ignore the export variable in karam / phantomsJs?
source share