add relativePath property to error object in order to play nicely with gulp-notify
This commit is contained in:
parent
d62227fb9d
commit
b3fe81f86a
2
index.js
2
index.js
|
@ -127,6 +127,8 @@ var gulpSass = function gulpSass(options, sync) {
|
||||||
error.messageFormatted = message;
|
error.messageFormatted = message;
|
||||||
error.message = gutil.colors.stripColor(message);
|
error.message = gutil.colors.stripColor(message);
|
||||||
|
|
||||||
|
error.relativePath = relativePath;
|
||||||
|
|
||||||
return cb(new gutil.PluginError(
|
return cb(new gutil.PluginError(
|
||||||
PLUGIN_NAME, error
|
PLUGIN_NAME, error
|
||||||
));
|
));
|
||||||
|
|
|
@ -379,6 +379,7 @@ describe('gulp-sass -- sync compile', function() {
|
||||||
|
|
||||||
stream.on('error', function(err) {
|
stream.on('error', function(err) {
|
||||||
err.message.indexOf('property "font" must be followed by a \':\'').should.not.equal(-1);
|
err.message.indexOf('property "font" must be followed by a \':\'').should.not.equal(-1);
|
||||||
|
err.relativePath.should.equal('test/scss/error.scss');
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
stream.write(errorFile);
|
stream.write(errorFile);
|
||||||
|
|
Loading…
Reference in a new issue