mirror of
https://github.com/documentationjs/documentation.git
synced 2025-12-08 18:23:43 +00:00
30 lines
519 B
JavaScript
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();
|
|
});
|