Debian Codegraph @

tests/browser/slim.html

raw
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta charset="utf-8">
5 <title>Mocha Tests (slim)</title>
6 <link rel="stylesheet" href="../../node_modules/mocha/mocha.css" />
7 </head>
8 <body>
9 <div id="mocha"></div>
10
11 <script src="../../node_modules/expect.js/index.js"></script>
12 <script src="../../node_modules/mocha/mocha.js"></script>
13 <script>
14 delete window.require;
15 typeof initMochaPhantomJS === 'function' && initMochaPhantomJS();
16 mocha.setup({
17 ui: 'bdd',
18 timeout: 10000
19 });
20 </script>
21
22 <!-- Load full nunjucks lib as window.nunjucksFull, so tests can run -->
23 <script src="nunjucks.min.js"></script>
24 <script type="text/javascript">
25 window.nunjucksFull = window.nunjucks;
26 window.nunjucks = undefined;
27 </script>
28 <script src="nunjucks-slim.min.js"></script>
29 <script src="../util.js"></script>
30 <script src="precompiled-templates.js"></script>
31 <script>
32 // Prefix all test suite titles with 'slim'
33 (function(originalDescribe) {
34 window.describe = window.suite = function describe(title, fn) {
35 originalDescribe('slim ' + title, fn);
36 };
37 })(window.describe || window.suite);
38
39 // Reset window.nunjucksPrecompiled so that it doesn't leak between tests
40 (function(precompiled) {
41 beforeEach(function(done) {
42 window.nunjucksPrecompiled = precompiled;
43 done();
44 });
45 afterEach(function(done) {
46 window.nunjucksPrecompiled = precompiled;
47 done();
48 });
49 })(window.nunjucksPrecompiled);
50 </script>
51
52 <script src="../compiler.js"></script>
53 <script src="../runtime.js"></script>
54 <script src="../filters.js"></script>
55 <script src="../globals.js"></script>
56 <script src="../jinja-compat.js"></script>
57 <script src="../tests.js"></script>
58
59 <script>
60 nunjucks.testing = true;
61 mocha.checkLeaks();
62 mocha.run();
63 </script>
64 </body>
65 </html>