var gulp = require("gulp");
var plumber = require("gulp-plumber");
var jasmine = require("gulp-jasmine");
var es = require("event-stream");
var fs = require("fs");

var generateTask = function({
  taskName,
  dependsOn = [],
}) {
  var testEntryContents = fs.readFileSync("test/entry.js");
  gulp.task(taskName, dependsOn, function (done) {
    gulp.src([
      "test/**/*.js",
      "!test/entry.js"
    ])
      .pipe(es.map(function (file, cb) {
        file.contents = new Buffer(`${testEntryContents}\n${file.contents}`);
        cb(null, file);
      }))
      .pipe(gulp.dest(".tmp/test/node/"))
      .pipe(plumber())
      .pipe(jasmine())
      .on("error", function (e) {
        console.log(e.toString());
      })
      .on("finish", done);
  });
};

module.exports = {
  generateTask,
};

@@ -102,66 +102,8 @@
 e%22);
-%0Avar es = require(%22event-stream%22);%0Avar fs = require(%22fs%22);
 %0A%0Ava
@@ -169,68 +169,8 @@
 ) %7B%0A
-  var testEntryContents = fs.readFileSync(%22test/entry.js%22);%0A
   gu
@@ -299,234 +299,119 @@
 ipe(
-es.map(function (file, cb) %7B%0A        file.contents = new Buffer(%60$%7BtestEntryContents%7D%5Cn$%7Bfile.contents%7D%60);%0A        cb(null, file);%0A      %7D))%0A      .pipe(gulp.dest(%22.tmp/test/node/%22))%0A      .pipe(plumber())%0A      .pipe(jasmine(
+plumber())%0A      .pipe(jasmine(%7B%0A        loadConfig: %7B%0A          helpers: %5B%22test/entry.js%22%5D,%0A        %7D,%0A      %7D
 ))%0A 

Fix - test:node pathing