From 85634326e8b7fd077b36d4b007190da2a66d6a89 Mon Sep 17 00:00:00 2001 From: kumavis Date: Sat, 14 Jan 2017 22:35:26 -0800 Subject: [PATCH] test - clear localStorage on test start --- test/unit/notice-controller-test.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/unit/notice-controller-test.js b/test/unit/notice-controller-test.js index e953fc580..cf00daeba 100644 --- a/test/unit/notice-controller-test.js +++ b/test/unit/notice-controller-test.js @@ -5,14 +5,14 @@ const nock = require('nock') const configManagerGen = require('../lib/mock-config-manager') const NoticeController = require('../../app/scripts/notice-controller') const STORAGE_KEY = 'metamask-persistance-key' -// Hacking localStorage support into JSDom -if (window.localStorage) window.localStorage.clear() -window.localStorage = {} describe('notice-controller', function() { var noticeController beforeEach(function() { + // simple localStorage polyfill + window.localStorage = {} + if (window.localStorage.clear) window.localStorage.clear() let configManager = configManagerGen() noticeController = new NoticeController({ configManager: configManager,