test: add test for instanceof ctor guard

master
Ryan Graham 2014-08-08 18:15:00 -07:00
parent dacdd080dc
commit e8aec58222
1 changed files with 8 additions and 0 deletions

View File

@ -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) {
t.throws(function () { bunyan.createLogger(); },
'options (object) is required',