diff options
author | Dan Finlay <dan@danfinlay.com> | 2016-07-26 08:33:22 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2016-07-26 08:33:22 +0800 |
commit | be74589f49bbe977f881b17a0383cafa4336d9b4 (patch) | |
tree | 304192beee2c6a53827ca3593515c896f34f9941 /test | |
parent | d484cb8f511a044c97a9a3bee3d4d415eb5988e7 (diff) | |
download | tangerine-wallet-browser-be74589f49bbe977f881b17a0383cafa4336d9b4.tar tangerine-wallet-browser-be74589f49bbe977f881b17a0383cafa4336d9b4.tar.gz tangerine-wallet-browser-be74589f49bbe977f881b17a0383cafa4336d9b4.tar.bz2 tangerine-wallet-browser-be74589f49bbe977f881b17a0383cafa4336d9b4.tar.lz tangerine-wallet-browser-be74589f49bbe977f881b17a0383cafa4336d9b4.tar.xz tangerine-wallet-browser-be74589f49bbe977f881b17a0383cafa4336d9b4.tar.zst tangerine-wallet-browser-be74589f49bbe977f881b17a0383cafa4336d9b4.zip |
Fix extension tests
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/extension-test.js | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/test/unit/extension-test.js b/test/unit/extension-test.js index 0a03a3b97..6b695e835 100644 --- a/test/unit/extension-test.js +++ b/test/unit/extension-test.js @@ -1,6 +1,8 @@ var assert = require('assert') var sinon = require('sinon') const ethUtil = require('ethereumjs-util') +GLOBAL.chrome = {} +GLOBAL.browser = {} var path = require('path') var Extension = require(path.join(__dirname, '..', '..', 'app', 'scripts', 'lib', 'extension-instance.js')) @@ -11,7 +13,7 @@ describe('extension', function() { let extension beforeEach(function() { - window.chrome = { + GLOBAL.chrome = { alarms: 'foo' } extension = new Extension() @@ -24,13 +26,20 @@ describe('extension', function() { describe('without chrome global', function() { let extension + let realWindow beforeEach(function() { - window.chrome = undefined - window.alarms = 'foo' + realWindow = window + window = GLOBAL + GLOBAL.chrome = undefined + GLOBAL.alarms = 'foo' extension = new Extension() }) + after(function() { + window = realWindow + }) + it('should use the global apis', function() { assert.equal(extension.alarms, 'foo') }) |