Browse Source

cleanup throw tests, add case for bad input

hk-custom-address
Kyle Drake 11 years ago
parent
commit
09925cff5a
No known key found for this signature in database GPG Key ID: 8BE721072E1864BE
  1. 14
      test/address.js

14
test/address.js

@ -31,13 +31,9 @@ describe('Address', function() {
}) })
it('throws error for invalid or unrecognized input', function() { it('throws error for invalid or unrecognized input', function() {
var addr = assert.throws(function() {
assert.throws(
function() {
new Address('beepboopbeepboopbeepboopbeepboopbeepboopbeep') new Address('beepboopbeepboopbeepboopbeepboopbeepboopbeep')
}, }, Error)
Error
)
}) })
it('works for byte input', function() { it('works for byte input', function() {
@ -51,6 +47,12 @@ describe('Address', function() {
assert.equal(addr.hash, hash) assert.equal(addr.hash, hash)
assert.equal(network.testnet.addressVersion, hash.version) assert.equal(network.testnet.addressVersion, hash.version)
}) })
it('fails for bad input', function() {
assert.throws(function() {
new Address('foo')
}, Error)
})
}) })
describe('getVersion', function() { describe('getVersion', function() {

Loading…
Cancel
Save