test: add test for instanceof ctor guard
This commit is contained in:
parent
dacdd080dc
commit
e8aec58222
1 changed files with 8 additions and 0 deletions
|
@ -53,6 +53,14 @@ test('ensure Logger creation options', function (t) {
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
test('ensure Logger constructor is safe without new', function (t) {
|
||||||
|
t.doesNotThrow(function () { Logger({name: 'foo'}); },
|
||||||
|
'constructor should call self with new if necessary');
|
||||||
|
|
||||||
|
t.end();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
test('ensure Logger creation options (createLogger)', function (t) {
|
test('ensure Logger creation options (createLogger)', function (t) {
|
||||||
t.throws(function () { bunyan.createLogger(); },
|
t.throws(function () { bunyan.createLogger(); },
|
||||||
'options (object) is required',
|
'options (object) is required',
|
||||||
|
|
Loading…
Reference in a new issue