diff options
author | Dan Finlay <dan@danfinlay.com> | 2016-04-19 02:31:06 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2016-04-19 02:31:06 +0800 |
commit | 8b62a8bec288120eee71523886f4c2df83b136ff (patch) | |
tree | 7ef8147b65ffff6a76d8f6a67327f093098b993f | |
parent | 83b8741bbb335ad1629b72180616835dbb3f5433 (diff) | |
download | tangerine-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
-rw-r--r-- | package.json | 3 | ||||
-rw-r--r-- | test/helper.js | 3 | ||||
-rw-r--r-- | test/unit/migrations-test.js | 13 |
3 files changed, 13 insertions, 6 deletions
diff --git a/package.json b/package.json index db0e2823a..f6bde2e4e 100644 --- a/package.json +++ b/package.json @@ -41,13 +41,14 @@ "metamask-logo": "^1.1.5", "multiplex": "^6.7.0", "pojo-migrator": "^2.1.0", + "polyfill-crypto.getrandomvalues": "^1.0.0", "pumpify": "^1.3.4", "react": "^0.14.3", "react-addons-css-transition-group": "^0.14.7", "react-dom": "^0.14.3", "react-hyperscript": "^2.2.2", - "readable-stream": "^2.0.5", "react-redux": "^4.0.3", + "readable-stream": "^2.0.5", "redux": "^3.0.5", "redux-logger": "^2.3.1", "redux-thunk": "^1.0.2", 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() + }) }) |