Skip to content

Commit daca90d

Browse files
authoredApr 8, 2018
Merge pull request #681 from DKvistgaard/master
Declaring logError as function instead of arrow function.
2 parents 450a7b8 + 71471c2 commit daca90d

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed
 

‎index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ gulpSass.sync = options => gulpSass(options, true);
150150
//////////////////////////////
151151
// Log errors nicely
152152
//////////////////////////////
153-
gulpSass.logError = (error) => {
153+
gulpSass.logError = function logError(error) {
154154
const message = new PluginError('sass', error.messageFormatted).toString();
155155
process.stderr.write(`${message}\n`);
156156
this.emit('end');

‎test/main.js

+18
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,15 @@ describe('gulp-sass -- async compile', () => {
140140
stream.write(sassFile);
141141
});
142142

143+
it('should emit logError on sass error', (done) => {
144+
const errorFile = createVinyl('error.scss');
145+
const stream = sass();
146+
147+
stream.on('error', sass.logError);
148+
stream.on('end', done);
149+
stream.write(errorFile);
150+
});
151+
143152
it('should handle sass errors', (done) => {
144153
const errorFile = createVinyl('error.scss');
145154
const stream = sass();
@@ -397,6 +406,15 @@ describe('gulp-sass -- sync compile', () => {
397406
stream.write(errorFile);
398407
});
399408

409+
it('should emit logError on sass error', (done) => {
410+
const errorFile = createVinyl('error.scss');
411+
const stream = sass.sync();
412+
413+
stream.on('error', sass.logError);
414+
stream.on('end', done);
415+
stream.write(errorFile);
416+
});
417+
400418
it('should work with gulp-sourcemaps', (done) => {
401419
const sassFile = createVinyl('inheritance.scss');
402420

0 commit comments

Comments
 (0)
Please sign in to comment.