aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
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() } })
+}