Comparing version 1.1.0 to 1.1.1
@@ -15,3 +15,3 @@ // Load modules | ||
Hoek.assert(this.constructor === internals.Boom, 'Error must be instantiated using new'); | ||
Hoek.assert(this instanceof internals.Boom, 'Error must be instantiated using new'); | ||
@@ -18,0 +18,0 @@ Error.call(this); |
{ | ||
"name": "boom", | ||
"description": "HTTP-friendly error objects", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"repository": "git://github.com/spumko/boom", | ||
@@ -6,0 +6,0 @@ "main": "index", |
@@ -5,4 +5,4 @@ // Load modules | ||
var Boom = require('../lib'); | ||
var Util = require('util'); | ||
// Declare internals | ||
@@ -505,4 +505,18 @@ | ||
}); | ||
describe('Boom subclasses', function () { | ||
it('can be subclassed to create custom errors', function (done) { | ||
function BoomSubclass(err) { | ||
Boom.call(this, err); | ||
this.upcaseMsg = err.message.toUpperCase(); | ||
} | ||
Util.inherits(BoomSubclass, Boom); | ||
var boomSubclass = new BoomSubclass(new Error('foo')); | ||
expect(boomSubclass.upcaseMsg).to.contain('FOO'); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
54754
554