diff --git a/test/general/index.js b/test/general/index.js index 7ed12b3a..ba5040a7 100644 --- a/test/general/index.js +++ b/test/general/index.js @@ -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'); }); diff --git a/test/general/openpgp.js b/test/general/openpgp.js index f42c77c9..c5ff626d 100644 --- a/test/general/openpgp.js +++ b/test/general/openpgp.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) { diff --git a/test/unittests.js b/test/unittests.js index 27b5c177..6dc2a4ae 100644 --- a/test/unittests.js +++ b/test/unittests.js @@ -7,8 +7,8 @@ }; describe('Unit Tests', function () { - require('./general'); require('./crypto'); + require('./general'); if (typeof window !== 'undefined') { require('./worker'); }