1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-22 17:33:23 +01:00

Fix plugin tests

This commit is contained in:
Dan Finlay 2016-04-18 11:31:06 -07:00
parent 83b8741bbb
commit 8b62a8bec2
3 changed files with 13 additions and 6 deletions

View File

@ -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",

View File

@ -1,2 +1,5 @@
require('jsdom-global')()
window.localStorage = {}
if (!('crypto' in window)) { window.crypto = {} }
window.crypto.getRandomValues = require('polyfill-crypto.getrandomvalues')

View File

@ -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()
})
})