From 06d559125aa4ddaa11597eefee46b75220afa2d1 Mon Sep 17 00:00:00 2001 From: julienmalard Date: Mon, 17 Feb 2025 15:51:21 +0100 Subject: [PATCH] Fix for browsers --- test/sync.test.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/sync.test.js b/test/sync.test.js index 70e8365..f87c8a9 100644 --- a/test/sync.test.js +++ b/test/sync.test.js @@ -682,7 +682,8 @@ describe('Sync protocol', function () { log1 = await Log(testIdentity1, { logId: 'synclog6' }) log2 = await Log(testIdentity2, { logId: 'synclog6' }) - process?.on('unhandledRejection', handleError) + if (typeof process !== "undefined" ) + process.on('unhandledRejection', handleError) }) after(async () => { @@ -702,7 +703,8 @@ describe('Sync protocol', function () { await ipfs1.stop() await ipfs2.stop() - process?.off('unhandledRejection', handleError) + if (typeof process !== "undefined" ) + process.off('unhandledRejection', handleError) }) it('does not crash when no listeners are attached to the `error` event on `Sync.events`', async () => {