all files / gulp-remove-logging/ test.js

25% Statements 3/12
100% Branches 0/0
0% Functions 0/2
25% Lines 3/12
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40                                                                         
/*
 * gulp-remove-logging
 * Based on ehynds/grunt-remove-logging
 *
 * Copyright 2016, Valerian Saliou
 * Author: Valerian Saliou <valerian@valeriansaliou.name>
 */
 
 
"use strict";
 
 
var path                 = require("path");
var assert               = require("assert");
var gutil                = require("gulp-util");
var gulp_remove_logging  = require("./");
 
 
it("should xxxxx", function (cb) {
  var stream = gulp_remove_logging({
    plugins: ["transform-es2015-block-scoping"]
  });
 
  stream.on("data", function (file) {
    assert(/var foo/.test(file.contents.toString()), file.contents.toString());
    assert.equal(file.relative, "fixture.js");
  });
 
  stream.on("end", cb);
 
  stream.write(new gutil.File({
    cwd: __dirname,
    base: path.join(__dirname, "fixture"),
    path: path.join(__dirname, "fixture/fixture.jsx"),
    contents: new Buffer("let foo;")
  }));
 
  stream.end();
});