2013-07-28 21:20:36 +02:00
|
|
|
require.config({
|
|
|
|
paths: {
|
|
|
|
"jasmine": "Libraries/jasmine-1.3.1/jasmine",
|
|
|
|
"jasmine-html": "Libraries/jasmine-1.3.1/jasmine-html",
|
|
|
|
"jasmine-console-reporter": "node_modules/jasmine-reporters/src/jasmine.console_reporter",
|
|
|
|
"jasmine-junit-reporter": "node_modules/jasmine-reporters/src/jasmine.junit_reporter"
|
|
|
|
},
|
|
|
|
// define module dependencies for modules not using define
|
|
|
|
shim: {
|
|
|
|
'jasmine-html': {
|
|
|
|
deps: ['jasmine'],
|
|
|
|
exports: 'jasmine'
|
|
|
|
},
|
|
|
|
'jasmine-console-reporter': {
|
|
|
|
deps: ['jasmine-html'],
|
|
|
|
exports: 'jasmine'
|
|
|
|
},
|
|
|
|
'jasmine-junit-reporter': {
|
|
|
|
deps: ['jasmine-html'],
|
|
|
|
exports: 'jasmine'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
require([
|
|
|
|
"jquery",
|
|
|
|
"converse",
|
|
|
|
"mock",
|
|
|
|
"jasmine-html",
|
|
|
|
"jasmine-console-reporter",
|
|
|
|
"jasmine-junit-reporter",
|
|
|
|
"spec/MainSpec",
|
|
|
|
"spec/ChatRoomSpec"
|
|
|
|
], function($, converse, mock_connection, jasmine) {
|
|
|
|
|
2013-05-11 14:20:07 +02:00
|
|
|
// Set up converse.js
|
|
|
|
window.localStorage.clear();
|
|
|
|
converse.initialize({
|
|
|
|
prebind: false,
|
|
|
|
xhr_user_search: false,
|
|
|
|
auto_subscribe: false,
|
|
|
|
animate: false
|
2013-04-15 10:01:07 +02:00
|
|
|
});
|
2013-05-11 14:20:07 +02:00
|
|
|
converse.onConnected(mock_connection);
|
|
|
|
|
|
|
|
// Jasmine stuff
|
|
|
|
var jasmineEnv = jasmine.getEnv();
|
2013-07-27 10:51:55 +02:00
|
|
|
if (/PhantomJS/.test(navigator.userAgent)) {
|
2013-07-28 22:21:56 +02:00
|
|
|
console.log('ehllo');
|
2013-07-27 10:51:55 +02:00
|
|
|
jasmineEnv.addReporter(new jasmine.TrivialReporter());
|
2013-07-28 22:21:56 +02:00
|
|
|
jasmineEnv.addReporter(new jasmine.JUnitXmlReporter('./test-reports/'));
|
2013-07-27 10:51:55 +02:00
|
|
|
jasmineEnv.addReporter(new jasmine.ConsoleReporter());
|
2013-07-28 22:21:56 +02:00
|
|
|
jasmineEnv.updateInterval = 0;
|
2013-07-27 10:51:55 +02:00
|
|
|
} else {
|
|
|
|
var htmlReporter = new jasmine.HtmlReporter();
|
|
|
|
jasmineEnv.addReporter(htmlReporter);
|
2013-07-28 21:20:36 +02:00
|
|
|
jasmineEnv.addReporter(new jasmine.ConsoleReporter());
|
2013-07-27 10:51:55 +02:00
|
|
|
jasmineEnv.specFilter = function(spec) {
|
|
|
|
return htmlReporter.specFilter(spec);
|
|
|
|
};
|
2013-07-28 22:21:56 +02:00
|
|
|
jasmineEnv.updateInterval = 250;
|
2013-07-27 10:51:55 +02:00
|
|
|
}
|
2013-05-11 14:20:07 +02:00
|
|
|
jasmineEnv.execute();
|
2013-04-15 10:01:07 +02:00
|
|
|
});
|