Skip to content

Instantly share code, notes, and snippets.

@mfbx9da4
Created May 24, 2017 21:38
Show Gist options
  • Save mfbx9da4/80d2377e0be42e99e388439c5cdebb5a to your computer and use it in GitHub Desktop.
Save mfbx9da4/80d2377e0be42e99e388439c5cdebb5a to your computer and use it in GitHub Desktop.
testing on jsbin Unit testing template // source http://jsbin.com/rovase
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Unit testing template">
<meta charset="utf-8">
<title>testing on jsbin</title>
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/mocha/1.18.2/mocha.css">
</head>
<body>
<div id="mocha"></div>
<script src="http://cdnjs.cloudflare.com/ajax/libs/mocha/1.18.2/mocha.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/chai/1.9.0/chai.js"></script>
<script id="jsbin-javascript">
'use strict';
function add(a, b) {
return a + b;
}
mocha.setup('bdd');
var expect = chai.expect;
describe('Module', function () {
it('2 + 2', function () {
expect(add(2, 2)).to.equal(4);
});
});
mocha.run();
</script>
<script id="jsbin-source-html" type="text/html"><!DOCTYPE html>
<html>
<head>
<meta name="description" content="Unit testing template">
<meta charset="utf-8">
<title>testing on jsbin</title>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/mocha/1.18.2/mocha.css">
</head>
<body>
<div id="mocha"></div>
<script src="//cdnjs.cloudflare.com/ajax/libs/mocha/1.18.2/mocha.js"><\/script>
<script src="//cdnjs.cloudflare.com/ajax/libs/chai/1.9.0/chai.js"><\/script>
</body>
</html></script>
<script id="jsbin-source-javascript" type="text/javascript">function add(a, b) {
return a + b
}
mocha.setup('bdd');
var expect = chai.expect;
describe('Module', function() {
it('2 + 2', function() {
expect(add(2, 2)).to.equal(4);
});
});
mocha.run();</script></body>
</html>
'use strict';
function add(a, b) {
return a + b;
}
mocha.setup('bdd');
var expect = chai.expect;
describe('Module', function () {
it('2 + 2', function () {
expect(add(2, 2)).to.equal(4);
});
});
mocha.run();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment