cleanup throw tests, add case for bad input
This commit is contained in:
parent
fdc78dad2e
commit
09925cff5a
1 changed files with 9 additions and 7 deletions
|
@ -31,13 +31,9 @@ describe('Address', function() {
|
|||
})
|
||||
|
||||
it('throws error for invalid or unrecognized input', function() {
|
||||
var addr =
|
||||
assert.throws(
|
||||
function() {
|
||||
assert.throws(function() {
|
||||
new Address('beepboopbeepboopbeepboopbeepboopbeepboopbeep')
|
||||
},
|
||||
Error
|
||||
)
|
||||
}, Error)
|
||||
})
|
||||
|
||||
it('works for byte input', function() {
|
||||
|
@ -51,6 +47,12 @@ describe('Address', function() {
|
|||
assert.equal(addr.hash, hash)
|
||||
assert.equal(network.testnet.addressVersion, hash.version)
|
||||
})
|
||||
|
||||
it('fails for bad input', function() {
|
||||
assert.throws(function() {
|
||||
new Address('foo')
|
||||
}, Error)
|
||||
})
|
||||
})
|
||||
|
||||
describe('getVersion', function() {
|
||||
|
|
Loading…
Reference in a new issue