From 5667666ffae15c169f99c7096ca59c05f9440272 Mon Sep 17 00:00:00 2001 From: Blaine Bublitz Date: Mon, 6 May 2019 19:09:08 +0200 Subject: [PATCH] Fix: Bind src/dest/symlink to the gulp instance to support esm exports (ref standard-things/esm#797) --- index.js | 3 +++ test/index.test.js | 60 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 test/index.test.js diff --git a/index.js b/index.js index cddf7eb6f..8b7352129 100644 --- a/index.js +++ b/index.js @@ -16,6 +16,9 @@ function Gulp() { this.registry = this.registry.bind(this); this.tree = this.tree.bind(this); this.lastRun = this.lastRun.bind(this); + this.src = this.src.bind(this); + this.dest = this.dest.bind(this); + this.symlink = this.symlink.bind(this); } util.inherits(Gulp, Undertaker); diff --git a/test/index.test.js b/test/index.test.js new file mode 100644 index 000000000..8921084d8 --- /dev/null +++ b/test/index.test.js @@ -0,0 +1,60 @@ +'use strict'; + +var expect = require('expect'); + +var gulp = require('../'); + +describe('gulp', function() { + + describe('hasOwnProperty', function() { + it('src', function(done) { + expect(gulp.hasOwnProperty('src')).toEqual(true); + done(); + }); + + it('dest', function(done) { + expect(gulp.hasOwnProperty('dest')).toEqual(true); + done(); + }); + + it('symlink', function(done) { + expect(gulp.hasOwnProperty('symlink')).toEqual(true); + done(); + }); + + it('watch', function(done) { + expect(gulp.hasOwnProperty('watch')).toEqual(true); + done(); + }); + + it('task', function(done) { + expect(gulp.hasOwnProperty('task')).toEqual(true); + done(); + }); + + it('series', function(done) { + expect(gulp.hasOwnProperty('series')).toEqual(true); + done(); + }); + + it('parallel', function(done) { + expect(gulp.hasOwnProperty('parallel')).toEqual(true); + done(); + }); + + it('tree', function(done) { + expect(gulp.hasOwnProperty('tree')).toEqual(true); + done(); + }); + + it('lastRun', function(done) { + expect(gulp.hasOwnProperty('lastRun')).toEqual(true); + done(); + }); + + it('registry', function(done) { + expect(gulp.hasOwnProperty('registry')).toEqual(true); + done(); + }); + }); +});