use typeforce >= 1.6.2 which allows us to use typeforce.TfTypeError
with a custom error message.
This commit is contained in:
parent
ce21c99b43
commit
7c7537fc57
3 changed files with 6 additions and 5 deletions
test
|
@ -26,14 +26,14 @@ describe('types', function () {
|
|||
assert(types.Hash256bit(buffer32byte))
|
||||
})
|
||||
|
||||
it('return false for incorrect size', function () {
|
||||
it('throws for incorrect size', function () {
|
||||
assert.throws(function () {
|
||||
types.Hash160bit(buffer32byte)
|
||||
}, 'Expected 160-bit Buffer, got Number 256')
|
||||
}, /Expected 160-bit Buffer, got 256-bit Buffer/)
|
||||
|
||||
assert.throws(function () {
|
||||
types.Hash256bit(buffer20byte)
|
||||
}, 'Expected 256-bit Buffer, got Number 160')
|
||||
}, /Expected 256-bit Buffer, got 160-bit Buffer/)
|
||||
})
|
||||
|
||||
it('return true for oneOf', function () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue