From 799b69eb1e511207947232f30a9d06142bf0eb69 Mon Sep 17 00:00:00 2001 From: Daniel Cousens Date: Sat, 31 May 2014 15:24:03 +1000 Subject: [PATCH] HDWallet: use assert.throws --- test/hdwallet.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/test/hdwallet.js b/test/hdwallet.js index 0fc7987..4de534a 100644 --- a/test/hdwallet.js +++ b/test/hdwallet.js @@ -23,13 +23,10 @@ describe('HDWallet', function() { it('fails with priv=true when theres no private key', function() { var hd = HDWallet.fromBase58('xpub6DF8uhdarytz3FWdA8TvFSvvAh8dP3283MY7p2V4SeE2wyWmG5mg5EwVvmdMVCQcoNJxGoWaU9DCWh89LojfZ537wTfunKau47EL2dhHKon') - try { + + assert.throws(function() { hd.toBase58(true) - } catch(e) { - assert(e.message.match(/private key/i)) - return - } - assert.fail() + }, /Missing private key/) }) })