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