From 9f67974133ae26b37d388cf95c995f76c0ee650f Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Wed, 23 Nov 2016 14:39:35 -0800 Subject: Fix last async keyring test --- test/unit/keyrings/hd-test.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'test') diff --git a/test/unit/keyrings/hd-test.js b/test/unit/keyrings/hd-test.js index 2c984267e..2d9e0ffd9 100644 --- a/test/unit/keyrings/hd-test.js +++ b/test/unit/keyrings/hd-test.js @@ -57,24 +57,26 @@ describe('hd-keyring', function() { describe('#deserialize a private key', function() { it('serializes what it deserializes', function(done) { + console.log('deserializing ' + sampleMnemonic) keyring.deserialize({ mnemonic: sampleMnemonic, numberOfAccounts: 1 }) .then(() => { + console.dir(keyring) assert.equal(keyring.wallets.length, 1, 'restores two accounts') - keyring.addAccounts(1) - - const accounts = keyring.getAccounts() + return keyring.addAccounts(1) + }).then(() => { + return keyring.getAccounts() + }).then((accounts) => { assert.equal(accounts[0], firstAcct) assert.equal(accounts[1], secondAcct) assert.equal(accounts.length, 2) - keyring.serialize() - .then((serialized) => { - assert.equal(serialized.mnemonic, sampleMnemonic) - done() - }) + return keyring.serialize() + }).then((serialized) => { + assert.equal(serialized.mnemonic, sampleMnemonic) + done() }) }) }) -- cgit