test: add test for instanceof ctor guard

This commit is contained in:
Ryan Graham 2014-08-08 18:15:00 -07:00
parent dacdd080dc
commit e8aec58222

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',