Skip to content

Commit

Permalink
fix(tests): improve tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tunnckoCore committed Mar 18, 2017
1 parent f2921bd commit aab16be
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,23 @@ test('should work when not defined line and column', function (done) {
cleanStacktraceMetadata(plugin)(line)
done()
})
test('should work when not place defined', function (done) {
function plugin (line, info) {
test.strictEqual(info.line, 33)

test('should get empty place when no place defined', function (done) {
cleanStacktraceMetadata(function plugin (line, info) {
test.strictEqual(info.filename, '/home/foo/test.js')
test.strictEqual(info.column, 2)
test.strictEqual(info.place, '')
test.strictEqual(info.filename, '/home/foo/test.js')
}
cleanStacktraceMetadata(plugin)('at /home/foo/test.js:33:2')
test.strictEqual(info.line, 33)
})('at /home/foo/test.js:33:2')
done()
})

test('should work for relative paths with no place', function (done) {
var res = cleanStacktraceMetadata(function (line, info) {
test.strictEqual(info.place, '')
return 'hoho'
})('at test.js:33:2')
test.strictEqual(res, 'hoho')
done()
})

Expand Down

0 comments on commit aab16be

Please sign in to comment.