Debian Codegraph @

test/index.html

raw
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta charset="utf-8">
5 <link href="https://unpkg.com/mocha@^3/mocha.css" rel="stylesheet">
6 </head>
7 <body>
8 <div id="mocha"></div>
9 <script src="https://unpkg.com/mocha@^3/mocha.js"></script>
10 <script>
11 mocha.setup('bdd');
12
13 window.TESTS_COMPLETE = false;
14 window.TESTS_PASSED = 0;
15 window.TESTS_FAILED = 0;
16
17 window.onload = function () {
18 var runner = mocha.run();
19
20 runner.on('test end', function (test) {
21 if (test.state === 'passed') window.TESTS_PASSED++;
22 else window.TESTS_FAILED++;
23 });
24
25 runner.on('end', function () {
26 window.TESTS_COMPLETE = true;
27 });
28 };
29 </script>
30 {{scripts}}
31 </body>
32 </html>