Skip to content

Commit

Permalink
reorganized
Browse files Browse the repository at this point in the history
  • Loading branch information
Milan Andric committed Mar 12, 2019
1 parent 4e5a990 commit 58fd6c3
Show file tree
Hide file tree
Showing 15 changed files with 31 additions and 34 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [],
Expand Down
3 changes: 3 additions & 0 deletions src/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
"default_popup": "popup.html"
},
"web_accessible_resources": [
"test.html"
"test/index.html"
]
}
2 changes: 1 addition & 1 deletion src/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
16 changes: 0 additions & 16 deletions src/test.html

This file was deleted.

2 changes: 1 addition & 1 deletion src/background.test.js → src/test/background.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import chai from './chai.js'
import browser from './browser.js'
import browser from '../browser.js'

const expect = chai.expect

Expand Down
File renamed without changes.
13 changes: 13 additions & 0 deletions src/test/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<html>
<head>
<meta charset="utf-8">
<title>Mocha Tests</title>
<link href="mocha.css" rel="stylesheet" />
<script src="mocha.js"></script>
</head>
<body>
<div id="mocha"></div>
<script src="setup.js"></script>
<script src="run.js"></script>
</body>
</html>
File renamed without changes.
2 changes: 1 addition & 1 deletion src/mocha.js → src/test/mocha.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down
4 changes: 4 additions & 0 deletions src/test/run.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import './state.test.js';
import './background.test.js';

mocha.run();
3 changes: 3 additions & 0 deletions src/test/setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import './chai.js';

mocha.setup('bdd');
3 changes: 1 addition & 2 deletions src/state.test.js → src/test/state.test.js
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -10,7 +10,6 @@ const populate = (length) => {
}
}


describe('state lib', () => {

beforeEach(() => {
Expand Down
4 changes: 0 additions & 4 deletions src/testrun.js

This file was deleted.

5 changes: 0 additions & 5 deletions src/testsetup.js

This file was deleted.

0 comments on commit 58fd6c3

Please sign in to comment.