Fix worker tests in compat browsers

This commit is contained in:
Daniel Huigens 2020-01-24 19:16:15 +01:00
parent e8ee70b2a8
commit 786d909f79
2 changed files with 8 additions and 2 deletions

View File

@ -11,6 +11,12 @@ tryTests('Application Worker', tests, {
function tests() {
it('Should support loading OpenPGP.js from inside a Web Worker', async function() {
try {
eval('async function() {}');
} catch (e) {
console.error(e);
this.skip();
}
const worker = new Worker('./worker/worker_example.js');
async function delegate(action, message) {
return new Promise((resolve, reject) => {

View File

@ -40,8 +40,8 @@ tryTests('Async Proxy', tests, {
await openpgp.initWorker({ path:'../dist/openpgp.worker.js' });
pubKey = (await openpgp.key.readArmored(pub_key)).keys[0];
},
after: function() {
openpgp.destroyWorker();
after: async function() {
await openpgp.destroyWorker();
}
});