1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

test - unit - import strategies - properly await async methods

This commit is contained in:
kumavis 2018-06-13 20:39:57 -07:00 committed by GitHub
parent b24efcb1cd
commit 62586b3b6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,26 +14,26 @@ describe('Account Import Strategies', function () {
})
it('throws an error for empty string private key', async () => {
assert.throws(function() {
accountImporter.importAccount('Private Key', [ '' ])
assert.throws(async function() {
await accountImporter.importAccount('Private Key', [ '' ])
}, Error, 'no empty strings')
})
it('throws an error for undefined string private key', async () => {
assert.throws(function () {
accountImporter.importAccount('Private Key', [ undefined ])
assert.throws(async function () {
await accountImporter.importAccount('Private Key', [ undefined ])
})
})
it('throws an error for undefined string private key', async () => {
assert.throws(function () {
accountImporter.importAccount('Private Key', [])
assert.throws(async function () {
await accountImporter.importAccount('Private Key', [])
})
})
it('throws an error for invalid private key', async () => {
assert.throws(function () {
accountImporter.importAccount('Private Key', [ 'popcorn' ])
assert.throws(async function () {
await accountImporter.importAccount('Private Key', [ 'popcorn' ])
})
})
})