aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2017-01-12 14:47:56 +0800
committerkumavis <aaron@kumavis.me>2017-01-12 14:47:56 +0800
commit3bc996878b467e1fa5fd63656bd465377daa137d (patch)
tree9c1661af778b58cd6d83c7d5fb5727f7a61b6dd9 /test/unit
parent2019c02fc0fc33d4bd98416654370250d7aa0ca6 (diff)
downloadtangerine-wallet-browser-3bc996878b467e1fa5fd63656bd465377daa137d.tar
tangerine-wallet-browser-3bc996878b467e1fa5fd63656bd465377daa137d.tar.gz
tangerine-wallet-browser-3bc996878b467e1fa5fd63656bd465377daa137d.tar.bz2
tangerine-wallet-browser-3bc996878b467e1fa5fd63656bd465377daa137d.tar.lz
tangerine-wallet-browser-3bc996878b467e1fa5fd63656bd465377daa137d.tar.xz
tangerine-wallet-browser-3bc996878b467e1fa5fd63656bd465377daa137d.tar.zst
tangerine-wallet-browser-3bc996878b467e1fa5fd63656bd465377daa137d.zip
background - move pojo migrator to outside of metamask controller
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/config-manager-test.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/test/unit/config-manager-test.js b/test/unit/config-manager-test.js
index 77d431d5f..83b242a8b 100644
--- a/test/unit/config-manager-test.js
+++ b/test/unit/config-manager-test.js
@@ -1,5 +1,8 @@
// polyfill fetch
global.fetch = global.fetch || require('isomorphic-fetch')
+// pollyfill localStorage support into JSDom
+global.localStorage = global.localStorage || polyfillLocalStorage()
+
const assert = require('assert')
const extend = require('xtend')
const rp = require('request-promise')
@@ -11,7 +14,7 @@ describe('config-manager', function() {
var configManager
beforeEach(function() {
- window.localStorage = {} // Hacking localStorage support into JSDom
+ global.localStorage.clear()
configManager = configManagerGen()
})
@@ -132,7 +135,6 @@ describe('config-manager', function() {
})
describe('#setConfig', function() {
- window.localStorage = {} // Hacking localStorage support into JSDom
it('should set the config key', function () {
var testConfig = {
@@ -238,3 +240,7 @@ describe('config-manager', function() {
})
})
})
+
+function polyfillLocalStorage(){
+ return Object.create({ clear: function(){ global.localStorage = polyfillLocalStorage() } })
+}