index.mustache 930 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <html>
  2. <head>
  3. <meta charset="utf-8">
  4. <title>Mocha Tests</title>
  5. <link href="/test/env/mocha.css" rel="stylesheet" />
  6. </head>
  7. <body>
  8. <div id="mocha"></div>
  9. <script src="/test/env/mocha.js"></script>
  10. <script src="/test/env/chai.js"></script>
  11. <script src="/lunr.js"></script>
  12. <script>
  13. mocha.setup('tdd')
  14. window.assert = chai.assert
  15. window.withFixture = function (name, fn) {
  16. var fixturePath = '/test/fixtures/' + name,
  17. xhr = new XMLHttpRequest
  18. xhr.addEventListener('load', function () {
  19. if (this.status != 200) {
  20. fn('non 200 response')
  21. } else {
  22. fn(null, this.responseText)
  23. }
  24. })
  25. xhr.open('GET', fixturePath)
  26. xhr.send()
  27. }
  28. </script>
  29. {{#test_files}}
  30. <script src="/{{{.}}}"></script>
  31. {{/test_files}}
  32. <script>
  33. mocha.checkLeaks();
  34. mocha.globals(['lunr']);
  35. mocha.run();
  36. </script>
  37. </body>
  38. </html>