Tom MacWright d7f06fa5c4 Store commentLineNumber on errors. Fixes #159
cc @jfirebaugh for the review
2015-10-06 16:23:22 -04:00

30 lines
519 B
JavaScript

'use strict';
var test = require('tap').test,
path = require('path'),
formatError = require('../../lib/format_error');
test('formatError', function (t) {
var comment = {
context: {
file: path.join(process.cwd(), 'file.js')
},
loc: {
start: {
line: 1
}
}
};
t.deepEqual(formatError(comment, {
message: 'test'
}), 'file.js:1: test');
t.deepEqual(formatError(comment, {
message: 'test',
commentLineNumber: 1
}), 'file.js:2: test');
t.end();
});