Skip to content

Commit

Permalink
Add test to show why 'can add a custom level to a prior instance' worked
Browse files Browse the repository at this point in the history
We expect levels added on one instance to not exist on other instances.
The test added shows, by failing, that the current code leak between
instances.
  • Loading branch information
Håkan Canberger committed Jan 15, 2017
1 parent a18f092 commit dbdd819
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/addlevel.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ test('can add a custom level to a prior instance', function (t) {
log.foo2('bar')
})

test('custom level via constructor does not affect other instances', function (t) {
t.plan(2)

var log = pino({level: 'foo3', levelVal: 36})
var other = pino()
t.is(typeof log.foo3, 'function')
t.is(typeof other.foo3, 'undefined')
})

test('custom levels encompass higher levels', function (t) {
t.plan(1)

Expand Down

0 comments on commit dbdd819

Please sign in to comment.