From fd3de76a9c0a92794962884825fa8609e564b7ec Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Fri, 2 Sep 2016 15:46:16 -0600 Subject: [PATCH 1/2] fix missing keypair in create test --- tests/basic.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/basic.js b/tests/basic.js index b8cb869..5dd9ffc 100644 --- a/tests/basic.js +++ b/tests/basic.js @@ -94,8 +94,9 @@ var tests = [ // create a new account , function () { var account = { - receipt: {} - , agreeTos: true + agreeTos: true + , keypair: goodGuy.keypair + , receipt: {} }; return leStore.accounts.setAsync(goodGuy, account).then(function (account) { From 8e23160ab24603f1fc8406aea3e4ce7146c3a26b Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Fri, 2 Sep 2016 16:38:05 -0600 Subject: [PATCH 2/2] throw if not account when there should be --- tests/basic.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/basic.js b/tests/basic.js index 5dd9ffc..5167666 100644 --- a/tests/basic.js +++ b/tests/basic.js @@ -146,6 +146,14 @@ var tests = [ email: goodGuy.email }).then(function (account) { + if (!account) { + throw new Error("should have returned account for " + goodGuy.email); + } + + if (!account.keypair) { + throw new Error("should have returned account.keypair for " + goodGuy.email); + } + if (goodGuy.keypair.privateKeyPem !== account.keypair.privateKeyPem) { if (account.keypair.privateKeyJwk) { throw new Error("Error in test itself (not your fault). TODO: implement checking privateKeyJwk.");