mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
40 lines
887 B
JavaScript
40 lines
887 B
JavaScript
|
var assert = require('assert')
|
||
|
var sinon = require('sinon')
|
||
|
const ethUtil = require('ethereumjs-util')
|
||
|
|
||
|
var path = require('path')
|
||
|
var Extension = require(path.join(__dirname, '..', '..', 'app', 'scripts', 'lib', 'extension-instance.js'))
|
||
|
|
||
|
describe('extension', function() {
|
||
|
|
||
|
describe('with chrome global', function() {
|
||
|
let extension
|
||
|
|
||
|
beforeEach(function() {
|
||
|
window.chrome = {
|
||
|
alarms: 'foo'
|
||
|
}
|
||
|
extension = new Extension()
|
||
|
})
|
||
|
|
||
|
it('should use the chrome global apis', function() {
|
||
|
assert.equal(extension.alarms, 'foo')
|
||
|
})
|
||
|
})
|
||
|
|
||
|
describe('without chrome global', function() {
|
||
|
let extension
|
||
|
|
||
|
beforeEach(function() {
|
||
|
window.chrome = undefined
|
||
|
window.alarms = 'foo'
|
||
|
extension = new Extension()
|
||
|
})
|
||
|
|
||
|
it('should use the global apis', function() {
|
||
|
assert.equal(extension.alarms, 'foo')
|
||
|
})
|
||
|
})
|
||
|
|
||
|
})
|