Commit | Line | Data |
---|---|---|
e8c70e4e DV |
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 --> | |
2a1f00d8 | 12 | <script src="../node_modules/babel-core/browser-polyfill.js"></script> |
e8c70e4e DV |
13 | |
14 | <!-- Mocha --> | |
15 | <script src="../node_modules/mocha/mocha.js"></script> | |
16 | <script src="../node_modules/chai/chai.js"></script> | |
17 | <script> | |
2a1f00d8 DV |
18 | if (window.initMochaPhantomJS) { |
19 | window.initMochaPhantomJS(); | |
20 | } | |
21 | </script> | |
22 | ||
23 | <script> | |
e8c70e4e DV |
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="../dist/tests.js"></script> | |
56 | ||
57 | <script> | |
58 | mocha.checkLeaks(); | |
ff876d52 DV |
59 | if (window.mochaPhantomJS) { |
60 | mochaPhantomJS.run(); | |
61 | } else { | |
62 | mocha.run(); | |
63 | } | |
e8c70e4e DV |
64 | </script> |
65 | </body> | |
66 | </html> |