usage
[dygraphs.git] / auto_tests / coverage.html
1 <html>
2 <head>
3 <meta charset="utf-8">
4 <title>dygraphs tests</title>
5 <link rel="stylesheet" href="../node_modules/mocha/mocha.css" />
6 </head>
7 <body>
8 <div id="graph"></div>
9 <div id="mocha"></div>
10
11 <!-- Polyfills for PhantomJS -->
12 <script src="../node_modules/babel-core/browser-polyfill.js"></script>
13
14 <!-- Mocha -->
15 <script src="../node_modules/mocha/mocha.js"></script>
16 <script src="../node_modules/chai/chai.js"></script>
17 <script>
18 if (window.initMochaPhantomJS) {
19 window.initMochaPhantomJS();
20 }
21 </script>
22
23 <script>
24 var expect = chai.expect;
25 var assert = chai.assert;
26 function cleanupAfterEach() {
27 // Clean up the DOM before each test.
28 // This makes debugging easier than cleaning up after each test, since the
29 // DOM stays on the screen after a failure.
30 beforeEach(function() {
31 var graph = document.getElementById('graph');
32 graph.innerHTML = '';
33 graph.setAttribute('style', '');
34 });
35 }
36 function useProxyCanvas(utils, Proxy) {
37 var _origFunc = utils.getContext;
38 beforeEach(function() {
39 utils.getContext = function(canvas) {
40 return new Proxy(_origFunc(canvas));
41 }
42 });
43
44 afterEach(function() {
45 utils.getContext = _origFunc;
46 });
47 }
48 </script>
49 <script>mocha.setup('bdd')</script>
50
51 <!-- Test data -->
52 <script src="data/data.js"></script>
53
54 <!-- Bundled tests -->
55 <script src="../coverage/tests.js"></script>
56
57 <script>
58 mocha.checkLeaks();
59 if (window.mochaPhantomJS) {
60 mochaPhantomJS.run();
61 } else {
62 mocha.run();
63 }
64 </script>
65 </body>
66 </html>