aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorKevin Serrano <kevgagser@gmail.com>2016-08-05 04:26:03 +0800
committerKevin Serrano <kevgagser@gmail.com>2016-08-05 04:26:03 +0800
commit479abadaa7dc59dc900cb35e897e0f164e3bb345 (patch)
tree07ea368e21d9c8277828e76e975f4671270b10a4 /test
parent0ae5305822b86e43c7921c53456a4042b4bc8af6 (diff)
parent106cbc133f26606449746587d4a33a3b8fb3f727 (diff)
downloadtangerine-wallet-browser-479abadaa7dc59dc900cb35e897e0f164e3bb345.tar
tangerine-wallet-browser-479abadaa7dc59dc900cb35e897e0f164e3bb345.tar.gz
tangerine-wallet-browser-479abadaa7dc59dc900cb35e897e0f164e3bb345.tar.bz2
tangerine-wallet-browser-479abadaa7dc59dc900cb35e897e0f164e3bb345.tar.lz
tangerine-wallet-browser-479abadaa7dc59dc900cb35e897e0f164e3bb345.tar.xz
tangerine-wallet-browser-479abadaa7dc59dc900cb35e897e0f164e3bb345.tar.zst
tangerine-wallet-browser-479abadaa7dc59dc900cb35e897e0f164e3bb345.zip
Merge branch 'master' into usd-conversion
Diffstat (limited to 'test')
-rw-r--r--test/unit/extension-test.js15
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')
})