1 | <html>
|
2 | <head>
|
3 | <title>Test</title>
|
4 | <meta charset="utf-8">
|
5 | <link rel="stylesheet" href="../../node_modules/mocha/mocha.css" />
|
6 | <script src="../../node_modules/mocha/mocha.js"></script>
|
7 | <script src="../../node_modules/chai/chai.js"></script>
|
8 | </head>
|
9 | <body>
|
10 | <div id="mocha"></div>
|
11 | <script>
|
12 | expect = chai.expect;
|
13 |
|
14 | describe('Event Tests', function() {
|
15 | it('Fails tests', function() {
|
16 | console.log('from test')
|
17 | expect(1).to.be.ok;
|
18 | });
|
19 | });
|
20 |
|
21 | var runner = mocha.run(function() {
|
22 | console.log('Run callback fired');
|
23 | });
|
24 |
|
25 |
|
26 |
|
27 |
|
28 | runner.$events['test end'].unshift(function(test) {
|
29 | console.log('from runner')
|
30 | runner.fail(test, new Error('Failed via an event'));
|
31 | });
|
32 | </script>
|
33 | </body>
|
34 | </html>
|