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 --> | |
12 | <script src="../node_modules/babel/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 | var expect = chai.expect; | |
19 | var assert = chai.assert; | |
20 | function cleanupAfterEach() { | |
21 | // Clean up the DOM before each test. | |
22 | // This makes debugging easier than cleaning up after each test, since the | |
23 | // DOM stays on the screen after a failure. | |
24 | beforeEach(function() { | |
25 | var graph = document.getElementById('graph'); | |
26 | graph.innerHTML = ''; | |
27 | graph.setAttribute('style', ''); | |
28 | }); | |
29 | } | |
30 | function useProxyCanvas(utils, Proxy) { | |
31 | var _origFunc = utils.getContext; | |
32 | beforeEach(function() { | |
33 | utils.getContext = function(canvas) { | |
34 | return new Proxy(_origFunc(canvas)); | |
35 | } | |
36 | }); | |
37 | ||
38 | afterEach(function() { | |
39 | utils.getContext = _origFunc; | |
40 | }); | |
41 | } | |
42 | </script> | |
43 | <script>mocha.setup('bdd')</script> | |
44 | ||
45 | <!-- Test data --> | |
46 | <script src="data/data.js"></script> | |
47 | ||
48 | <!-- Bundled tests --> | |
49 | <script src="../dist/tests.js"></script> | |
50 | ||
51 | <script> | |
52 | mocha.checkLeaks(); | |
53 | if (window.mochaPhantomJS) { | |
54 | mochaPhantomJS.run(); | |
55 | } else { | |
56 | mocha.run(); | |
57 | } | |
58 | </script> | |
59 | </body> | |
60 | </html> |