2013-08-19 15:13:32 -04:00
|
|
|
'use strict';
|
|
|
|
|
2014-07-02 10:46:17 -04:00
|
|
|
// Mozilla bind polyfill because phantomjs is stupid
|
|
|
|
if (!Function.prototype.bind) {
|
|
|
|
Function.prototype.bind = function(oThis) {
|
|
|
|
if (typeof this !== "function") {
|
|
|
|
// closest thing possible to the ECMAScript 5 internal IsCallable function
|
|
|
|
throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
|
|
|
|
}
|
|
|
|
|
|
|
|
var aArgs = Array.prototype.slice.call(arguments, 1),
|
|
|
|
fToBind = this,
|
|
|
|
FNOP = function() {},
|
|
|
|
fBound = function() {
|
|
|
|
return fToBind.apply(this instanceof FNOP && oThis ? this : oThis, aArgs.concat(Array.prototype.slice.call(arguments)));
|
|
|
|
};
|
|
|
|
|
|
|
|
FNOP.prototype = this.prototype;
|
|
|
|
fBound.prototype = new FNOP();
|
|
|
|
|
|
|
|
return fBound;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2013-08-19 15:13:32 -04:00
|
|
|
require(['../../src/require-config'], function() {
|
|
|
|
require.config({
|
2013-11-11 11:56:51 -05:00
|
|
|
baseUrl: '../../src/lib',
|
|
|
|
paths: {
|
|
|
|
angularMocks: '../../test/lib/angular-mocks'
|
|
|
|
},
|
|
|
|
shim: {
|
|
|
|
angularMocks: {
|
|
|
|
exports: 'angular.mock',
|
|
|
|
deps: ['angular']
|
|
|
|
}
|
|
|
|
}
|
2013-08-19 15:13:32 -04:00
|
|
|
});
|
|
|
|
|
2013-11-11 11:56:51 -05:00
|
|
|
|
2013-08-19 15:13:32 -04:00
|
|
|
// Start the main app logic.
|
2014-06-18 11:09:04 -04:00
|
|
|
require(['js/app-config', 'axe'], function(app, axe) {
|
2013-08-19 15:13:32 -04:00
|
|
|
app.config.workerPath = '../../src/js';
|
|
|
|
|
2014-06-18 11:09:04 -04:00
|
|
|
// turn off logging in the test
|
|
|
|
axe.removeAppender(axe.defaultAppender);
|
|
|
|
|
2013-08-19 15:13:32 -04:00
|
|
|
startTests();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
function startTests() {
|
|
|
|
mocha.setup('bdd');
|
|
|
|
|
|
|
|
require(
|
|
|
|
[
|
2014-06-05 09:36:53 -04:00
|
|
|
'test/unit/oauth-test',
|
|
|
|
'test/unit/auth-test',
|
|
|
|
'test/unit/email-dao-test',
|
|
|
|
'test/unit/app-controller-test',
|
|
|
|
'test/unit/pgp-test',
|
|
|
|
'test/unit/crypto-test',
|
|
|
|
'test/unit/rest-dao-test',
|
|
|
|
'test/unit/publickey-dao-test',
|
2014-06-06 12:36:23 -04:00
|
|
|
'test/unit/privatekey-dao-test',
|
2014-06-05 09:36:53 -04:00
|
|
|
'test/unit/lawnchair-dao-test',
|
|
|
|
'test/unit/keychain-dao-test',
|
|
|
|
'test/unit/devicestorage-dao-test',
|
|
|
|
'test/unit/dialog-ctrl-test',
|
|
|
|
'test/unit/add-account-ctrl-test',
|
|
|
|
'test/unit/account-ctrl-test',
|
|
|
|
'test/unit/set-passphrase-ctrl-test',
|
|
|
|
'test/unit/contacts-ctrl-test',
|
|
|
|
'test/unit/login-existing-ctrl-test',
|
|
|
|
'test/unit/login-initial-ctrl-test',
|
|
|
|
'test/unit/login-new-device-ctrl-test',
|
2014-06-13 06:33:30 -04:00
|
|
|
'test/unit/login-privatekey-download-ctrl-test',
|
|
|
|
'test/unit/privatekey-upload-ctrl-test',
|
2014-06-05 09:36:53 -04:00
|
|
|
'test/unit/login-ctrl-test',
|
|
|
|
'test/unit/read-ctrl-test',
|
|
|
|
'test/unit/navigation-ctrl-test',
|
|
|
|
'test/unit/mail-list-ctrl-test',
|
|
|
|
'test/unit/write-ctrl-test',
|
|
|
|
'test/unit/outbox-bo-test',
|
|
|
|
'test/unit/invitation-dao-test',
|
|
|
|
'test/unit/update-handler-test'
|
2013-08-19 15:13:32 -04:00
|
|
|
], function() {
|
|
|
|
//Tests loaded, run tests
|
|
|
|
mocha.run();
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|