Create an example that includes tests and how to run them. #122 (#130)

This commit is contained in:
Mykyta Khmel
2016-12-01 01:09:28 +02:00
committed by Kumar McMillan
parent 01181a350b
commit 395786e353
19 changed files with 214 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
<!DOCTYPE html>
<html>
<head>
<title>Tests for background</title>
<meta charset="utf-8">
<link rel="stylesheet" href="../node_modules/mocha/mocha.css"/>
</head>
<body>
<div id="mocha"></div>
<script src="../node_modules/mocha/mocha.js"></script>
<script src="../node_modules/chai/chai.js"></script>
<script src="../node_modules/expect.js/index.js"></script>
<script src="../node_modules/chrome-mock/browser.js"></script>
<script>
mocha.ui('bdd');
mocha.reporter('html');
expect = chai.expect;
</script>
<script src="../addon/background.js"></script>
<script src="lib/background.test.js"></script>
<script>
mocha.run();
</script>
</body>
</html>
@@ -0,0 +1,9 @@
describe('Background', function() {
describe('ping', function() {
it('should return pong in response', function() {
Background.ping(false, false, function(response) {
expect(response).to.equal('pong');
});
});
});
});