Browse Source
cleanup throw tests, add case for bad input
hk-custom-address
Kyle Drake
11 years ago
No known key found for this signature in database
GPG Key ID: 8BE721072E1864BE
1 changed files with
9 additions and
7 deletions
-
test/address.js
|
|
@ -31,13 +31,9 @@ describe('Address', function() { |
|
|
|
}) |
|
|
|
|
|
|
|
it('throws error for invalid or unrecognized input', function() { |
|
|
|
var addr = |
|
|
|
assert.throws( |
|
|
|
function() { |
|
|
|
new Address('beepboopbeepboopbeepboopbeepboopbeepboopbeep') |
|
|
|
}, |
|
|
|
Error |
|
|
|
) |
|
|
|
assert.throws(function() { |
|
|
|
new Address('beepboopbeepboopbeepboopbeepboopbeepboopbeep') |
|
|
|
}, 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() { |
|
|
|