diff --git a/package.json b/package.json index a66924f..ff50547 100644 --- a/package.json +++ b/package.json @@ -10,9 +10,9 @@ "test": "tests" }, "scripts": { - "server": "http-server -c-1 src", - "build": "parcel build --public-url ./ --no-minify --no-source-maps src/manifest.json", - "build:prod": "parcel build --public-url ./ src/manifest.json", + "server": "http-server -c-1 dist", + "start": "parcel src/manifest.json", + "build": "parcel build --public-url ./ src/manifest.json", "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [], diff --git a/src/background.js b/src/background.js index 1f6fa77..6ceb17d 100644 --- a/src/background.js +++ b/src/background.js @@ -54,6 +54,9 @@ const tabRemoved = (id, props) => { state.unset(id); } +console.log('browser'); +console.log(browser); + browser.tabs.onActivated.addListener(tabActivated); browser.tabs.onUpdated.addListener(tabUpdated); browser.tabs.onRemoved.addListener(tabRemoved); diff --git a/src/manifest.json b/src/manifest.json index 0672bd1..8f8d676 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -13,6 +13,6 @@ "default_popup": "popup.html" }, "web_accessible_resources": [ - "test.html" + "test/index.html" ] } diff --git a/src/popup.js b/src/popup.js index a03d7e9..30b3124 100644 --- a/src/popup.js +++ b/src/popup.js @@ -5,5 +5,5 @@ document.getElementById('reset').onclick = function(el) { browser.runtime.reload() } document.getElementById('test').onclick = function(el) { - window.open(browser.extension.getURL("test.html"), '_blank') + window.open(browser.extension.getURL("test/index.html"), '_blank') } diff --git a/src/test.html b/src/test.html deleted file mode 100644 index 95b6d33..0000000 --- a/src/test.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - - Mocha Tests - - - - - - -
- - - - diff --git a/src/background.test.js b/src/test/background.test.js similarity index 95% rename from src/background.test.js rename to src/test/background.test.js index 23f7c5b..4299a0a 100644 --- a/src/background.test.js +++ b/src/test/background.test.js @@ -1,5 +1,5 @@ import chai from './chai.js' -import browser from './browser.js' +import browser from '../browser.js' const expect = chai.expect diff --git a/src/chai.js b/src/test/chai.js similarity index 100% rename from src/chai.js rename to src/test/chai.js diff --git a/src/test/index.html b/src/test/index.html new file mode 100644 index 0000000..8765f1d --- /dev/null +++ b/src/test/index.html @@ -0,0 +1,13 @@ + + + + Mocha Tests + + + + +
+ + + + diff --git a/src/mocha.css b/src/test/mocha.css similarity index 100% rename from src/mocha.css rename to src/test/mocha.css diff --git a/src/mocha.js b/src/test/mocha.js similarity index 99% rename from src/mocha.js rename to src/test/mocha.js index 342bf46..3681c93 100644 --- a/src/mocha.js +++ b/src/test/mocha.js @@ -17903,7 +17903,7 @@ function hasOwnProperty(obj, prop) { },{"./support/isBuffer":87,"_process":68,"inherits":86}],89:[function(require,module,exports){ module.exports={ "name": "mocha", - "version": "6.0.1", + "version": "6.0.2", "homepage": "https://mochajs.org/", "notifyLogo": "https://ibin.co/4QuRuGjXvl36.png" } diff --git a/src/test/run.js b/src/test/run.js new file mode 100644 index 0000000..17046e1 --- /dev/null +++ b/src/test/run.js @@ -0,0 +1,4 @@ +import './state.test.js'; +import './background.test.js'; + +mocha.run(); diff --git a/src/test/setup.js b/src/test/setup.js new file mode 100644 index 0000000..ace45ed --- /dev/null +++ b/src/test/setup.js @@ -0,0 +1,3 @@ +import './chai.js'; + +mocha.setup('bdd'); diff --git a/src/state.test.js b/src/test/state.test.js similarity index 97% rename from src/state.test.js rename to src/test/state.test.js index 21de275..7c46982 100644 --- a/src/state.test.js +++ b/src/test/state.test.js @@ -1,6 +1,6 @@ console.log('testing state lib') import chai from './chai.js' -import state from './state.js' +import state from '../state.js' const expect = chai.expect @@ -10,7 +10,6 @@ const populate = (length) => { } } - describe('state lib', () => { beforeEach(() => { diff --git a/src/testrun.js b/src/testrun.js deleted file mode 100644 index dcb3fce..0000000 --- a/src/testrun.js +++ /dev/null @@ -1,4 +0,0 @@ -console.log('loading testrun') -import './state.test.js' -import './background.test.js' -mocha.run(); diff --git a/src/testsetup.js b/src/testsetup.js deleted file mode 100644 index 233c912..0000000 --- a/src/testsetup.js +++ /dev/null @@ -1,5 +0,0 @@ -console.log('loading testsetup'); -//import chai from './chai.js' -import mocha from './mocha.js' -mocha.setup('bdd') -mocha.growl() // Enables web notifications