Commit de07b6a5 authored by JC Brand's avatar JC Brand

No need for two AMD-load cycles.

parent 6abd805b
(function (root, factory) { (function (root, factory) {
define([ define([
"jquery", "jquery",
"converse-api",
"underscore", "underscore",
"utils", "utils",
"mock", "mock",
"test_utils" "test_utils"
], factory); ], factory);
} (this, function ($, _, utils, mock, test_utils) { } (this, function ($, converse_api, _, utils, mock, test_utils) {
"use strict"; "use strict";
var $iq = converse_api.env.$iq, var $iq = converse_api.env.$iq,
Strophe = converse_api.env.Strophe; Strophe = converse_api.env.Strophe;
......
(function (root, factory) { (function (root, factory) {
define([ define([
"utils", "utils",
"converse-api",
"mock", "mock",
"test_utils" "test_utils"
], factory); ], factory);
} (this, function (utils, mock, test_utils) { } (this, function (utils, converse_api, mock, test_utils) {
"use strict"; "use strict";
var _ = converse_api.env._; var _ = converse_api.env._;
var $ = converse_api.env.jQuery; var $ = converse_api.env.jQuery;
......
(function (root, factory) { (function (root, factory) {
define(["mock", "test_utils", "utils" ], factory); define(["mock", "converse-api", "test_utils", "utils" ], factory);
} (this, function (mock, test_utils, utils) { } (this, function (mock, converse_api, test_utils, utils) {
var _ = converse_api.env._; var _ = converse_api.env._;
var $ = converse_api.env.jQuery; var $ = converse_api.env.jQuery;
var $pres = converse_api.env.$pres; var $pres = converse_api.env.$pres;
......
(function (root, factory) { (function (root, factory) {
define(["mock", "test_utils"], factory); define(["mock", "converse-api", "test_utils"], factory);
} (this, function (mock, test_utils) { } (this, function (mock, converse_api, test_utils) {
var _ = converse_api.env._; var _ = converse_api.env._;
var $ = converse_api.env.jQuery; var $ = converse_api.env.jQuery;
var $pres = converse_api.env.$pres; var $pres = converse_api.env.$pres;
......
(function (root, factory) { (function (root, factory) {
define([ define([
"jquery", "jquery",
"converse-api",
"underscore", "underscore",
"mock", "mock",
"test_utils" "test_utils"], factory);
], function ($, _, mock, test_utils) { } (this, function ($, converse_api, _, mock, test_utils) {
return factory($, _, mock, test_utils);
}
);
} (this, function ($, _, mock, test_utils) {
var b64_sha1 = converse_api.env.b64_sha1; var b64_sha1 = converse_api.env.b64_sha1;
describe("Converse", function() { describe("Converse", function() {
......
(function (root, factory) { (function (root, factory) {
define([ define([
"jquery", "jquery",
"converse-api",
"mock", "mock",
"test_utils" "test_utils"], factory);
], function ($, mock, test_utils) { } (this, function ($, converse_api, mock, test_utils) {
return factory($, mock, test_utils);
}
);
} (this, function ($, mock, test_utils) {
"use strict"; "use strict";
var Strophe = converse_api.env.Strophe; var Strophe = converse_api.env.Strophe;
......
(function (root, factory) { (function (root, factory) {
define(["mock", "test_utils"], factory); define(["mock", "converse-api", "test_utils"], factory);
} (this, function (mock, test_utils) { } (this, function (mock, converse_api, test_utils) {
return describe("The Converse Event Emitter", function() { return describe("The Converse Event Emitter", function() {
......
(function (root, factory) { (function (root, factory) {
define([ define([
"jquery", "jquery",
"converse-api",
"utils", "utils",
"mock", "mock",
"test_utils" "test_utils"
], factory); ], factory);
} (this, function ($, utils, mock, test_utils) { } (this, function ($, converse_api, utils, mock, test_utils) {
"use strict"; "use strict";
var $msg = converse_api.env.$msg, var $msg = converse_api.env.$msg,
_ = converse_api.env._; _ = converse_api.env._;
......
(function (root, factory) { (function (root, factory) {
define(["mock", "test_utils"], factory); define(["mock", "converse-api", "test_utils"], factory);
} (this, function (mock, test_utils) { } (this, function (mock, converse_api, test_utils) {
"use strict"; "use strict";
var _ = converse_api.env._; var _ = converse_api.env._;
var $ = converse_api.env.jQuery; var $ = converse_api.env.jQuery;
......
(function (root, factory) { (function (root, factory) {
define(["mock", "test_utils"], factory); define(["mock", "converse-api", "test_utils"], factory);
} (this, function (mock, test_utils) { } (this, function (mock, converse_api, test_utils) {
var _ = converse_api.env._; var _ = converse_api.env._;
var $msg = converse_api.env.$msg; var $msg = converse_api.env.$msg;
......
(function (root, factory) { (function (root, factory) {
define(["mock", "test_utils"], factory); define(["mock", "converse-api", "test_utils"], factory);
} (this, function (mock, test_utils) { } (this, function (mock, converse_api, test_utils) {
"use strict"; "use strict";
var $msg = converse_api.env.$msg; var $msg = converse_api.env.$msg;
......
(function (root, factory) { (function (root, factory) {
define(["mock","test_utils" ], factory); define(["mock", "converse-api", "test_utils"], factory);
} (this, function (mock, test_utils) { } (this, function (mock, converse_api, test_utils) {
var $ = converse_api.env.jQuery; var $ = converse_api.env.jQuery;
var Strophe = converse_api.env.Strophe; var Strophe = converse_api.env.Strophe;
var b64_sha1 = converse_api.env.b64_sha1; var b64_sha1 = converse_api.env.b64_sha1;
......
(function (root, factory) { (function (root, factory) {
define(["mock", "test_utils", "converse-ping"], factory); define(["mock", "converse-api", "test_utils", "converse-ping"], factory);
} (this, function (mock, test_utils) { } (this, function (mock, converse_api, test_utils) {
"use strict"; "use strict";
describe("XMPP Ping", function () { describe("XMPP Ping", function () {
......
(function (root, factory) { (function (root, factory) {
define(["mock", "test_utils"], factory); define(["mock", "converse-api", "test_utils"], factory);
} (this, function (mock, test_utils) { } (this, function (mock, converse_api, test_utils) {
var _ = converse_api.env._; var _ = converse_api.env._;
var $iq = converse_api.env.$iq; var $iq = converse_api.env.$iq;
......
(function (root, factory) { (function (root, factory) {
define([ define([
"jquery", "jquery",
"converse-api",
"mock", "mock",
"test_utils" "test_utils"], factory);
], function ($, mock, test_utils) { } (this, function ($, converse_api, mock, test_utils) {
return factory($, mock, test_utils);
}
);
} (this, function ($, mock, test_utils) {
"use strict"; "use strict";
var Strophe = converse_api.env.Strophe; var Strophe = converse_api.env.Strophe;
var $iq = converse_api.env.$iq; var $iq = converse_api.env.$iq;
......
(function (root, factory) { (function (root, factory) {
define(["mock", "test_utils"], factory); define(["mock", "converse-api", "test_utils"], factory);
} (this, function (mock, test_utils) { } (this, function (mock, converse_api, test_utils) {
var $ = converse_api.env.jQuery; var $ = converse_api.env.jQuery;
var Strophe = converse_api.env.Strophe; var Strophe = converse_api.env.Strophe;
var $iq = converse_api.env.$iq; var $iq = converse_api.env.$iq;
......
(function (root, factory) { (function (root, factory) {
define(["mock", "test_utils"], factory); define(["mock", "converse-api", "test_utils"], factory);
} (this, function (mock, test_utils) { } (this, function (mock, converse_api, test_utils) {
var $ = converse_api.env.jQuery; var $ = converse_api.env.jQuery;
return describe("The XMPPStatus model", function() { return describe("The XMPPStatus model", function() {
......
...@@ -10,6 +10,9 @@ config.shim['jasmine-html'] = { ...@@ -10,6 +10,9 @@ config.shim['jasmine-html'] = {
deps: ['jasmine'], deps: ['jasmine'],
exports: 'jasmine' exports: 'jasmine'
}; };
config.shim['console-runner'] = {
deps: ['jasmine']
};
require.config(config); require.config(config);
// Polyfill 'bind' which is not available in phantomjs < 2.0 // Polyfill 'bind' which is not available in phantomjs < 2.0
...@@ -34,18 +37,9 @@ if (!Function.prototype.bind) { ...@@ -34,18 +37,9 @@ if (!Function.prototype.bind) {
require([ require([
"jquery", "jquery",
"converse",
"mock", "mock",
"jasmine-html", "jasmine-html",
"sinon" "sinon",
], function($, converse, mock, jasmine, sinon) {
// Set up converse.js
window.sinon = sinon;
window.converse_api = converse;
window.localStorage.clear();
window.sessionStorage.clear();
require([
"console-runner", "console-runner",
//"spec/transcripts", //"spec/transcripts",
"spec/utils", "spec/utils",
...@@ -66,7 +60,10 @@ require([ ...@@ -66,7 +60,10 @@ require([
"spec/ping", "spec/ping",
"spec/register", "spec/register",
"spec/xmppstatus" "spec/xmppstatus"
], function () { ], function($, mock, jasmine, sinon) {
window.sinon = sinon;
window.localStorage.clear();
window.sessionStorage.clear();
// Jasmine stuff // Jasmine stuff
var jasmineEnv = jasmine.getEnv(); var jasmineEnv = jasmine.getEnv();
var reporter; var reporter;
...@@ -84,6 +81,5 @@ require([ ...@@ -84,6 +81,5 @@ require([
jasmineEnv.updateInterval = 0; jasmineEnv.updateInterval = 0;
} }
jasmineEnv.execute(); jasmineEnv.execute();
});
} }
); );
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment