From a8f745f9fe74751b87f500af3857b66d4c80f45e Mon Sep 17 00:00:00 2001 From: brunobar79 Date: Mon, 2 Jul 2018 18:49:33 -0400 Subject: eslint --fix . --- test/unit/app/seed-phrase-verifier-test.js | 86 +++++++++++++++--------------- 1 file changed, 43 insertions(+), 43 deletions(-) (limited to 'test/unit/app/seed-phrase-verifier-test.js') diff --git a/test/unit/app/seed-phrase-verifier-test.js b/test/unit/app/seed-phrase-verifier-test.js index b0da534da..88c4e8d67 100644 --- a/test/unit/app/seed-phrase-verifier-test.js +++ b/test/unit/app/seed-phrase-verifier-test.js @@ -9,8 +9,8 @@ describe('SeedPhraseVerifier', function () { describe('verifyAccounts', function () { - let password = 'passw0rd1' - let hdKeyTree = 'HD Key Tree' + const password = 'passw0rd1' + const hdKeyTree = 'HD Key Tree' let keyringController let vault @@ -30,54 +30,54 @@ describe('SeedPhraseVerifier', function () { it('should be able to verify created account with seed words', async function () { - let createdAccounts = await primaryKeyring.getAccounts() + const createdAccounts = await primaryKeyring.getAccounts() assert.equal(createdAccounts.length, 1) - let serialized = await primaryKeyring.serialize() - let seedWords = serialized.mnemonic + const serialized = await primaryKeyring.serialize() + const seedWords = serialized.mnemonic assert.notEqual(seedWords.length, 0) - - let result = await seedPhraseVerifier.verifyAccounts(createdAccounts, seedWords) + + const result = await seedPhraseVerifier.verifyAccounts(createdAccounts, seedWords) }) it('should be able to verify created account (upper case) with seed words', async function () { - let createdAccounts = await primaryKeyring.getAccounts() + const createdAccounts = await primaryKeyring.getAccounts() assert.equal(createdAccounts.length, 1) - let upperCaseAccounts = [createdAccounts[0].toUpperCase()] + const upperCaseAccounts = [createdAccounts[0].toUpperCase()] - let serialized = await primaryKeyring.serialize() - let seedWords = serialized.mnemonic + const serialized = await primaryKeyring.serialize() + const seedWords = serialized.mnemonic assert.notEqual(seedWords.length, 0) - - let result = await seedPhraseVerifier.verifyAccounts(upperCaseAccounts, seedWords) + + const result = await seedPhraseVerifier.verifyAccounts(upperCaseAccounts, seedWords) }) it('should be able to verify created account (lower case) with seed words', async function () { - let createdAccounts = await primaryKeyring.getAccounts() + const createdAccounts = await primaryKeyring.getAccounts() assert.equal(createdAccounts.length, 1) - let lowerCaseAccounts = [createdAccounts[0].toLowerCase()] + const lowerCaseAccounts = [createdAccounts[0].toLowerCase()] - let serialized = await primaryKeyring.serialize() - let seedWords = serialized.mnemonic + const serialized = await primaryKeyring.serialize() + const seedWords = serialized.mnemonic assert.notEqual(seedWords.length, 0) - - let result = await seedPhraseVerifier.verifyAccounts(lowerCaseAccounts, seedWords) + + const result = await seedPhraseVerifier.verifyAccounts(lowerCaseAccounts, seedWords) }) it('should return error with good but different seed words', async function () { - let createdAccounts = await primaryKeyring.getAccounts() + const createdAccounts = await primaryKeyring.getAccounts() assert.equal(createdAccounts.length, 1) - let serialized = await primaryKeyring.serialize() - let seedWords = 'debris dizzy just program just float decrease vacant alarm reduce speak stadium' - - try { - let result = await seedPhraseVerifier.verifyAccounts(createdAccounts, seedWords) - assert.fail("Should reject") + const serialized = await primaryKeyring.serialize() + const seedWords = 'debris dizzy just program just float decrease vacant alarm reduce speak stadium' + + try { + const result = await seedPhraseVerifier.verifyAccounts(createdAccounts, seedWords) + assert.fail('Should reject') } catch (err) { assert.ok(err.message.indexOf('Not identical accounts!') >= 0, 'Wrong error message') } @@ -85,15 +85,15 @@ describe('SeedPhraseVerifier', function () { it('should return error with undefined existing accounts', async function () { - let createdAccounts = await primaryKeyring.getAccounts() + const createdAccounts = await primaryKeyring.getAccounts() assert.equal(createdAccounts.length, 1) - let serialized = await primaryKeyring.serialize() - let seedWords = 'debris dizzy just program just float decrease vacant alarm reduce speak stadium' + const serialized = await primaryKeyring.serialize() + const seedWords = 'debris dizzy just program just float decrease vacant alarm reduce speak stadium' - try { - let result = await seedPhraseVerifier.verifyAccounts(undefined, seedWords) - assert.fail("Should reject") + try { + const result = await seedPhraseVerifier.verifyAccounts(undefined, seedWords) + assert.fail('Should reject') } catch (err) { assert.equal(err.message, 'No created accounts defined.') } @@ -101,15 +101,15 @@ describe('SeedPhraseVerifier', function () { it('should return error with empty accounts array', async function () { - let createdAccounts = await primaryKeyring.getAccounts() + const createdAccounts = await primaryKeyring.getAccounts() assert.equal(createdAccounts.length, 1) - let serialized = await primaryKeyring.serialize() - let seedWords = 'debris dizzy just program just float decrease vacant alarm reduce speak stadium' + const serialized = await primaryKeyring.serialize() + const seedWords = 'debris dizzy just program just float decrease vacant alarm reduce speak stadium' - try { - let result = await seedPhraseVerifier.verifyAccounts([], seedWords) - assert.fail("Should reject") + try { + const result = await seedPhraseVerifier.verifyAccounts([], seedWords) + assert.fail('Should reject') } catch (err) { assert.equal(err.message, 'No created accounts defined.') } @@ -120,14 +120,14 @@ describe('SeedPhraseVerifier', function () { const keyState = await keyringController.addNewAccount(primaryKeyring) const keyState2 = await keyringController.addNewAccount(primaryKeyring) - let createdAccounts = await primaryKeyring.getAccounts() + const createdAccounts = await primaryKeyring.getAccounts() assert.equal(createdAccounts.length, 3) - let serialized = await primaryKeyring.serialize() - let seedWords = serialized.mnemonic + const serialized = await primaryKeyring.serialize() + const seedWords = serialized.mnemonic assert.notEqual(seedWords.length, 0) - - let result = await seedPhraseVerifier.verifyAccounts(createdAccounts, seedWords) + + const result = await seedPhraseVerifier.verifyAccounts(createdAccounts, seedWords) }) }) }) -- cgit From 0da41263acabe99fb1bf6b1a3a00c0c27a305eea Mon Sep 17 00:00:00 2001 From: brunobar79 Date: Mon, 2 Jul 2018 20:12:50 -0400 Subject: fix warning for unit tests --- test/unit/app/seed-phrase-verifier-test.js | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'test/unit/app/seed-phrase-verifier-test.js') diff --git a/test/unit/app/seed-phrase-verifier-test.js b/test/unit/app/seed-phrase-verifier-test.js index 88c4e8d67..d8720d5a0 100644 --- a/test/unit/app/seed-phrase-verifier-test.js +++ b/test/unit/app/seed-phrase-verifier-test.js @@ -13,7 +13,6 @@ describe('SeedPhraseVerifier', function () { const hdKeyTree = 'HD Key Tree' let keyringController - let vault let primaryKeyring beforeEach(async function () { @@ -24,7 +23,7 @@ describe('SeedPhraseVerifier', function () { assert(keyringController) - vault = await keyringController.createNewVaultAndKeychain(password) + await keyringController.createNewVaultAndKeychain(password) primaryKeyring = keyringController.getKeyringsByType(hdKeyTree)[0] }) @@ -37,7 +36,7 @@ describe('SeedPhraseVerifier', function () { const seedWords = serialized.mnemonic assert.notEqual(seedWords.length, 0) - const result = await seedPhraseVerifier.verifyAccounts(createdAccounts, seedWords) + await seedPhraseVerifier.verifyAccounts(createdAccounts, seedWords) }) it('should be able to verify created account (upper case) with seed words', async function () { @@ -51,7 +50,7 @@ describe('SeedPhraseVerifier', function () { const seedWords = serialized.mnemonic assert.notEqual(seedWords.length, 0) - const result = await seedPhraseVerifier.verifyAccounts(upperCaseAccounts, seedWords) + await seedPhraseVerifier.verifyAccounts(upperCaseAccounts, seedWords) }) it('should be able to verify created account (lower case) with seed words', async function () { @@ -64,7 +63,7 @@ describe('SeedPhraseVerifier', function () { const seedWords = serialized.mnemonic assert.notEqual(seedWords.length, 0) - const result = await seedPhraseVerifier.verifyAccounts(lowerCaseAccounts, seedWords) + await seedPhraseVerifier.verifyAccounts(lowerCaseAccounts, seedWords) }) it('should return error with good but different seed words', async function () { @@ -72,11 +71,11 @@ describe('SeedPhraseVerifier', function () { const createdAccounts = await primaryKeyring.getAccounts() assert.equal(createdAccounts.length, 1) - const serialized = await primaryKeyring.serialize() + await primaryKeyring.serialize() const seedWords = 'debris dizzy just program just float decrease vacant alarm reduce speak stadium' try { - const result = await seedPhraseVerifier.verifyAccounts(createdAccounts, seedWords) + await seedPhraseVerifier.verifyAccounts(createdAccounts, seedWords) assert.fail('Should reject') } catch (err) { assert.ok(err.message.indexOf('Not identical accounts!') >= 0, 'Wrong error message') @@ -88,11 +87,11 @@ describe('SeedPhraseVerifier', function () { const createdAccounts = await primaryKeyring.getAccounts() assert.equal(createdAccounts.length, 1) - const serialized = await primaryKeyring.serialize() + await primaryKeyring.serialize() const seedWords = 'debris dizzy just program just float decrease vacant alarm reduce speak stadium' try { - const result = await seedPhraseVerifier.verifyAccounts(undefined, seedWords) + await seedPhraseVerifier.verifyAccounts(undefined, seedWords) assert.fail('Should reject') } catch (err) { assert.equal(err.message, 'No created accounts defined.') @@ -104,11 +103,11 @@ describe('SeedPhraseVerifier', function () { const createdAccounts = await primaryKeyring.getAccounts() assert.equal(createdAccounts.length, 1) - const serialized = await primaryKeyring.serialize() + await primaryKeyring.serialize() const seedWords = 'debris dizzy just program just float decrease vacant alarm reduce speak stadium' try { - const result = await seedPhraseVerifier.verifyAccounts([], seedWords) + await seedPhraseVerifier.verifyAccounts([], seedWords) assert.fail('Should reject') } catch (err) { assert.equal(err.message, 'No created accounts defined.') @@ -117,8 +116,8 @@ describe('SeedPhraseVerifier', function () { it('should be able to verify more than one created account with seed words', async function () { - const keyState = await keyringController.addNewAccount(primaryKeyring) - const keyState2 = await keyringController.addNewAccount(primaryKeyring) + await keyringController.addNewAccount(primaryKeyring) + await keyringController.addNewAccount(primaryKeyring) const createdAccounts = await primaryKeyring.getAccounts() assert.equal(createdAccounts.length, 3) @@ -127,7 +126,7 @@ describe('SeedPhraseVerifier', function () { const seedWords = serialized.mnemonic assert.notEqual(seedWords.length, 0) - const result = await seedPhraseVerifier.verifyAccounts(createdAccounts, seedWords) + await seedPhraseVerifier.verifyAccounts(createdAccounts, seedWords) }) }) }) -- cgit