Skip to content

Commit

Permalink
fix(reporter): preserve base/absolute word in error
Browse files Browse the repository at this point in the history
Previously, any error log message containing the words `absolute` or `base`
would have those words munged by the error formatter.
  • Loading branch information
chrisirhc committed Sep 21, 2015
1 parent c8b5dc3 commit b3798df
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/reporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ var createErrorFormatter = function (basePath, emitter, SourceMapConsumer) {
}
}

return path + (line ? ':' + line : '') + (column ? ':' + column : '')
var result = path + (line ? ':' + line : '') + (column ? ':' + column : '')
return result || prefix
})

// indent every line
Expand Down
10 changes: 10 additions & 0 deletions test/unit/reporter.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,16 @@ describe('reporter', () => {
expect(formatError(ERROR)).to.equal('at /usr/path.js:2\n')
})

it('should preserve absolute word', () => {
var ERROR = 'contains absolute'
expect(formatError(ERROR)).to.equal('contains absolute\n')
})

it('should preserve base word', () => {
var ERROR = 'contains base'
expect(formatError(ERROR)).to.equal('contains base\n')
})

describe('source maps', () => {
class MockSourceMapConsumer {
constructor (sourceMap) {
Expand Down

0 comments on commit b3798df

Please sign in to comment.