aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-04-19 02:31:06 +0800
committerDan Finlay <dan@danfinlay.com>2016-04-19 02:31:06 +0800
commit8b62a8bec288120eee71523886f4c2df83b136ff (patch)
tree7ef8147b65ffff6a76d8f6a67327f093098b993f /test
parent83b8741bbb335ad1629b72180616835dbb3f5433 (diff)
downloadtangerine-wallet-browser-8b62a8bec288120eee71523886f4c2df83b136ff.tar
tangerine-wallet-browser-8b62a8bec288120eee71523886f4c2df83b136ff.tar.gz
tangerine-wallet-browser-8b62a8bec288120eee71523886f4c2df83b136ff.tar.bz2
tangerine-wallet-browser-8b62a8bec288120eee71523886f4c2df83b136ff.tar.lz
tangerine-wallet-browser-8b62a8bec288120eee71523886f4c2df83b136ff.tar.xz
tangerine-wallet-browser-8b62a8bec288120eee71523886f4c2df83b136ff.tar.zst
tangerine-wallet-browser-8b62a8bec288120eee71523886f4c2df83b136ff.zip
Fix plugin tests
Diffstat (limited to 'test')
-rw-r--r--test/helper.js3
-rw-r--r--test/unit/migrations-test.js13
2 files changed, 11 insertions, 5 deletions
diff --git a/test/helper.js b/test/helper.js
index 4c7f8b4c6..64fe5bd07 100644
--- a/test/helper.js
+++ b/test/helper.js
@@ -1,2 +1,5 @@
require('jsdom-global')()
window.localStorage = {}
+
+if (!('crypto' in window)) { window.crypto = {} }
+window.crypto.getRandomValues = require('polyfill-crypto.getrandomvalues')
diff --git a/test/unit/migrations-test.js b/test/unit/migrations-test.js
index 3a3213ac5..3429ffb1d 100644
--- a/test/unit/migrations-test.js
+++ b/test/unit/migrations-test.js
@@ -1,14 +1,17 @@
+var assert = require('assert')
var test = require('tape')
var path = require('path')
var wallet1 = require(path.join('..', 'lib', 'migrations', '001.json'))
var migration2 = require(path.join('..', '..', 'app', 'scripts', 'migrations', '002'))
-test('wallet1 is migrated successfully', function(t) {
-
- var result = migration2.migrate(wallet1.data)
- t.equal(result.config.provider.type, 'rpc', 'provider should be rpc')
- t.equal(result.config.provider.rpcTarget, 'https://rpc.metamask.io/', 'provider should be our rpc')
+describe('wallet1 is migrated successfully', function() {
+ it('should convert etherscan provider', function(done) {
+ var result = migration2.migrate(wallet1.data)
+ assert.equal(result.config.provider.type, 'rpc', 'provider should be rpc')
+ assert.equal(result.config.provider.rpcTarget, 'https://rpc.metamask.io/', 'provider should be our rpc')
+ done()
+ })
})