From a63311bd34afb5566c9f58bac69a27fa865e7b10 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sat, 5 May 2018 15:08:01 +0900 Subject: [PATCH] mock browser --- karma.conf.js | 2 +- test/main.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/karma.conf.js b/karma.conf.js index b85480f..871e62a 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -4,7 +4,7 @@ module.exports = function (config) { config.set({ basePath: '', - frameworks: ['mocha'], + frameworks: ['mocha', 'sinon'], files: [ 'test/main.js', 'test/**/*.test.js', diff --git a/test/main.js b/test/main.js index d923aaa..3aeae69 100644 --- a/test/main.js +++ b/test/main.js @@ -1,2 +1,6 @@ import chai from 'chai'; +const browserFake = require('webextensions-api-fake'); +const browser = browserFake(); + global.expect = chai.expect; +global.browser = browser;