runner.js 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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/user-details-modal",
  53. "spec/messages",
  54. "spec/chatroom",
  55. "spec/minchats",
  56. "spec/notification",
  57. "spec/login",
  58. "spec/register",
  59. "spec/http-file-upload"
  60. ];
  61. require(['console-reporter', 'mock', 'sinon', 'wait-until-promise', 'pluggable'],
  62. function(ConsoleReporter, mock, sinon, waitUntilPromise, pluggable) {
  63. if (config.view_mode) {
  64. mock.view_mode = config.view_mode;
  65. }
  66. window.sinon = sinon;
  67. window.waitUntilPromise = waitUntilPromise.default;
  68. window.localStorage.clear();
  69. window.sessionStorage.clear();
  70. // Load the specs
  71. require(specs, function (jasmine) {
  72. var jasmineEnv = jasmine.getEnv();
  73. jasmineEnv.addReporter(new ConsoleReporter());
  74. window.onload();
  75. });
  76. });