up
This commit is contained in:
parent
4ae129054e
commit
ab9ab64bd5
476 changed files with 3370 additions and 532 deletions
|
@ -0,0 +1,34 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<!-- add mocha css, to show results -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/mocha/3.2.0/mocha.css">
|
||||
<!-- add mocha framework code -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mocha/3.2.0/mocha.js"></script>
|
||||
<script>
|
||||
// enable bdd-style testing
|
||||
mocha.setup('bdd');
|
||||
</script>
|
||||
<!-- add chai -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/chai/3.5.0/chai.js"></script>
|
||||
<script>
|
||||
// chai has a lot of stuff, let's make assert global
|
||||
let assert = chai.assert;
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<!-- the script with tests (describe, it...) -->
|
||||
<script src="test.js"></script>
|
||||
|
||||
<!-- the element with id="mocha" will contain test results -->
|
||||
<div id="mocha"></div>
|
||||
|
||||
<!-- run tests! -->
|
||||
<script>
|
||||
mocha.run();
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -0,0 +1,12 @@
|
|||
describe("test", function() {
|
||||
|
||||
before(() => alert("Testing started – before all tests"));
|
||||
after(() => alert("Testing finished – after all tests"));
|
||||
|
||||
beforeEach(() => alert("Before a test – enter a test"));
|
||||
afterEach(() => alert("After a test – exit a test"));
|
||||
|
||||
it('test 1', () => alert(1));
|
||||
it('test 2', () => alert(2));
|
||||
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue