1 | <!DOCTYPE html>
|
2 | <html>
|
3 | <head>
|
4 | <meta charset="utf-8">
|
5 | <title>SimplyBind Test Runner</title>
|
6 | <link rel="stylesheet" type="text/css" href="bower_components/mocha/mocha.css">
|
7 | </head>
|
8 |
|
9 | <body>
|
10 | <div id="mocha"></div>
|
11 | <script src="../node_modules/@danielkalen/polyfills/polyfills.js"></script>
|
12 | <script src="../dist/simplybind.pretty.js"></script>
|
13 | <script src="bower_components/mocha/mocha.js"></script>
|
14 | <script src="bower_components/chai/chai.js"></script>
|
15 | <script src="bower_components/chai-spies/chai-spies.js"></script>
|
16 | <script src="bower_components/jquery/dist/jquery.min.js"></script>
|
17 | <script src="bower_components/sinon/sinon.js"></script>
|
18 | <script src="spec-helper.js"></script>
|
19 | <script src="spec.js"></script>
|
20 | <script>
|
21 | if (typeof console === 'undefined') {
|
22 | window.console = {
|
23 | log: function(){},
|
24 | debug: function(){},
|
25 | info: function(){},
|
26 | warn: function(){},
|
27 | error: function(){}
|
28 | }
|
29 | }
|
30 | </script>
|
31 | <script>
|
32 | var runner = mocha.run(),
|
33 | failedTests = [];
|
34 |
|
35 | runner.on('end', function(){
|
36 | window.mochaResults = runner.stats;
|
37 | window.mochaResults.reports = failedTests;
|
38 | });
|
39 |
|
40 | runner.on('fail', function(test, err){
|
41 | failedTests.push({
|
42 | 'name': test.title,
|
43 | 'result': false,
|
44 | 'message': err.message,
|
45 | 'stack': err.stack,
|
46 | 'titles': (function(){
|
47 | var titles = [];
|
48 | while (test.parent.title) {
|
49 | titles.push(test.parent.title);
|
50 | test = test.parent;
|
51 | }
|
52 | return titles.reverse();
|
53 | })()
|
54 | });
|
55 | });
|
56 | </script>
|
57 | </body>
|
58 | </html>
|