rearrange test order and fix web worker detection
This commit is contained in:
parent
6ff470a36a
commit
128a95ace4
|
@ -1,12 +1,12 @@
|
||||||
describe('General', function () {
|
describe('General', function () {
|
||||||
require('./util.js');
|
require('./util.js');
|
||||||
|
require('./armor.js');
|
||||||
|
require('./packet.js');
|
||||||
|
require('./keyring.js');
|
||||||
|
require('./signature.js');
|
||||||
|
require('./key.js');
|
||||||
require('./openpgp.js');
|
require('./openpgp.js');
|
||||||
require('./basic.js');
|
require('./basic.js');
|
||||||
require('./armor.js');
|
|
||||||
require('./key.js');
|
|
||||||
require('./keyring.js');
|
|
||||||
require('./packet.js');
|
|
||||||
require('./signature.js');
|
|
||||||
require('./hkp.js');
|
require('./hkp.js');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -360,21 +360,22 @@ describe('OpenPGP.js public api tests', function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('without Worker', tests);
|
describe('without Worker', tests);
|
||||||
|
|
||||||
|
if (typeof window !== 'undefined' && window.Worker) {
|
||||||
describe('with Worker', function() {
|
describe('with Worker', function() {
|
||||||
before(function() {
|
before(function() {
|
||||||
openpgp.initWorker({ path:'../dist/openpgp.worker.js' });
|
openpgp.initWorker({ path:'../dist/openpgp.worker.js' });
|
||||||
});
|
});
|
||||||
|
|
||||||
if (openpgp.getWorker()) {
|
|
||||||
tests();
|
tests();
|
||||||
} else {
|
|
||||||
it.skip('No Web Worker support --> skipping tests.');
|
|
||||||
}
|
|
||||||
|
|
||||||
after(function() {
|
after(function() {
|
||||||
openpgp.destroyWorker(); // cleanup worker in case of failure
|
openpgp.destroyWorker(); // cleanup worker in case of failure
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
describe.skip('with Worker (No Web Worker support --> skipping tests)', tests);
|
||||||
|
}
|
||||||
|
|
||||||
function tests() {
|
function tests() {
|
||||||
it('Calling decrypt with not decrypted key leads to exception', function (done) {
|
it('Calling decrypt with not decrypted key leads to exception', function (done) {
|
||||||
|
|
|
@ -7,8 +7,8 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
describe('Unit Tests', function () {
|
describe('Unit Tests', function () {
|
||||||
require('./general');
|
|
||||||
require('./crypto');
|
require('./crypto');
|
||||||
|
require('./general');
|
||||||
if (typeof window !== 'undefined') {
|
if (typeof window !== 'undefined') {
|
||||||
require('./worker');
|
require('./worker');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user