From a724649f307d46c36e0e6fa25e085227f98880a5 Mon Sep 17 00:00:00 2001 From: Sanjana Rajan Date: Mon, 27 Nov 2017 22:07:32 -0800 Subject: [PATCH] fix assert is not defined issue --- test/general/key.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/general/key.js b/test/general/key.js index b950b05f..eb06c53d 100644 --- a/test/general/key.js +++ b/test/general/key.js @@ -1146,8 +1146,8 @@ describe('Key', function() { it('Throw user friendly error when reformatting encrypted key', () => { return openpgp.generateKey({numBits: 1024, userIds: 'test1 ', passphrase: '1234'}).then(function(original) { - return openpgp.reformatKey({privateKey: original.key, userIds: 'test2 ', passphrase: '1234'}).then(function(newKey) { - assert.fail('reformatKey should result in error when key not decrypted'); + return openpgp.reformatKey({privateKey: original.key, userIds: 'test2 ', passphrase: '1234'}).then(function() { + throw new Error('reformatKey should result in error when key not decrypted'); }).catch(function(error) { expect(error.message).to.equal('Error reformatting keypair: Key not decrypted'); });