runner.js 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*global config */
  2. // Extra test dependencies
  3. config.baseUrl = '../';
  4. config.paths.jquery = "node_modules/jquery/dist/jquery";
  5. config.paths.mock = "tests/mock";
  6. config.paths['wait-until-promise'] = "node_modules/wait-until-promise/index";
  7. config.paths['test-utils'] = "tests/utils";
  8. config.paths.sinon = "node_modules/sinon/pkg/sinon";
  9. config.paths.transcripts = "converse-logs/converse-logs";
  10. config.paths["jasmine-core"] = "node_modules/jasmine-core/lib/jasmine-core/jasmine";
  11. config.paths.jasmine = "node_modules/jasmine-core/lib/jasmine-core/boot";
  12. config.paths["jasmine-console"] = "node_modules/jasmine-core/lib/console/console";
  13. config.paths["console-reporter"] = "tests/console-reporter";
  14. config.paths["jasmine-html"] = "node_modules/jasmine-core/lib/jasmine-core/jasmine-html";
  15. config.shim.jasmine = {
  16. exports: 'window.jasmineRequire'
  17. };
  18. config.shim['jasmine-html'] = {
  19. deps: ['jasmine-core'],
  20. exports: 'window.jasmineRequire'
  21. };
  22. config.shim['jasmine-console'] = {
  23. deps: ['jasmine-core'],
  24. exports: 'window.jasmineRequire'
  25. };
  26. config.shim.jasmine = {
  27. deps: ['jasmine-core', 'jasmine-html', 'jasmine-console'],
  28. exports: 'window.jasmine'
  29. };
  30. require.config(config);
  31. var specs = [
  32. "jasmine",
  33. //"spec/transcripts",
  34. "spec/spoilers",
  35. "spec/profiling",
  36. "spec/utils",
  37. "spec/converse",
  38. "spec/bookmarks",
  39. "spec/roomslist",
  40. "spec/headline",
  41. "spec/disco",
  42. "spec/protocol",
  43. "spec/presence",
  44. "spec/eventemitter",
  45. "spec/ping",
  46. "spec/xmppstatus",
  47. "spec/mam",
  48. "spec/otr",
  49. "spec/controlbox",
  50. "spec/roster",
  51. "spec/chatbox",
  52. "spec/chatroom",
  53. "spec/minchats",
  54. "spec/notification",
  55. "spec/register"
  56. ];
  57. require(['console-reporter', 'mock', 'sinon', 'wait-until-promise', 'pluggable'],
  58. function(ConsoleReporter, mock, sinon, waitUntilPromise, pluggable) {
  59. if (config.view_mode) {
  60. mock.view_mode = config.view_mode;
  61. }
  62. window.sinon = sinon;
  63. window.waitUntilPromise = waitUntilPromise.default;
  64. window.localStorage.clear();
  65. window.sessionStorage.clear();
  66. // Load the specs
  67. require(specs, function (jasmine) {
  68. var jasmineEnv = jasmine.getEnv();
  69. jasmineEnv.addReporter(new ConsoleReporter());
  70. window.onload();
  71. });
  72. });