I had to use the path package to solve this problem.
var path = require("path"), fs = require("fs"); gulp.task('test', function (done) { karma.start({ configFile: fs.readFile(path.join(__dirname, '../test/', 'karma.conf.js')), singleRun: true }, done); });
source share