not really known
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.4 KiB

  1. <html>
  2. <head>
  3. <meta charset="utf-8"/>
  4. <title>Sugarizer Tests</title>
  5. <link href="https://cdn.rawgit.com/mochajs/mocha/2.3.0/mocha.css" rel="stylesheet" />
  6. </head>
  7. <body>
  8. <div id="mocha"></div>
  9. <script src="../lib/require.js"></script>
  10. <script src="../lib/chai.js"></script>
  11. <script src="../lib/jquery.min.js"></script>
  12. <script src="https://cdn.rawgit.com/Automattic/expect.js/0.3.1/index.js"></script>
  13. <script src="https://cdn.rawgit.com/mochajs/mocha/2.3.0/mocha.js"></script>
  14. <script>mocha.setup('bdd')</script>
  15. <script src="datastore.js"></script>
  16. <script src="presence.js"></script>
  17. <script>
  18. // Init mocha
  19. mocha.checkLeaks();
  20. mocha.globals(['sugar*']);
  21. requirejs.config({ baseUrl: "../lib" });
  22. // Init Sugarizer settings
  23. var initSugarizer = function(updatedSettings) {
  24. window.localStorage.clear();
  25. var initSettings = {
  26. name: "Mocha",
  27. color: 163,
  28. colorvalue: { stroke: '#AC32FF', fill: '#FF8F00' }
  29. };
  30. if (updatedSettings) {
  31. for (var key in updatedSettings) {
  32. initSettings[key] = updatedSettings[key];
  33. }
  34. }
  35. window.localStorage.setItem("sugar_settings", JSON.stringify(initSettings));
  36. };
  37. // Init modules
  38. var datastore;
  39. var chai;
  40. var presence;
  41. initSugarizer();
  42. requirejs(["sugar-web/datastore", "chai", "sugar-web/presence"], function(d, c, p) {
  43. datastore = d;
  44. chai = c;
  45. presence = p;
  46. // Run tests
  47. mocha.run();
  48. });
  49. </script>
  50. </body>
  51. </html>