From 786d909f79cfb71584dd37675a0ee8d5ad587f3f Mon Sep 17 00:00:00 2001 From: Daniel Huigens Date: Fri, 24 Jan 2020 19:16:15 +0100 Subject: [PATCH] Fix worker tests in compat browsers --- test/worker/application_worker.js | 6 ++++++ test/worker/async_proxy.js | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/test/worker/application_worker.js b/test/worker/application_worker.js index 6750434d..41764d49 100644 --- a/test/worker/application_worker.js +++ b/test/worker/application_worker.js @@ -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) => { diff --git a/test/worker/async_proxy.js b/test/worker/async_proxy.js index 0fe02bb0..bedc9739 100644 --- a/test/worker/async_proxy.js +++ b/test/worker/async_proxy.js @@ -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(); } });