From e2cfd5384712707131fa0f41953b4ec0564853a0 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Thu, 24 Mar 2022 13:17:59 +0100 Subject: [PATCH] techdocs: update client test to work with jsdom environment Signed-off-by: Patrik Oldsberg --- plugins/techdocs/src/client.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/techdocs/src/client.test.ts b/plugins/techdocs/src/client.test.ts index 71ad57d12a..8236b93c55 100644 --- a/plugins/techdocs/src/client.test.ts +++ b/plugins/techdocs/src/client.test.ts @@ -221,7 +221,7 @@ describe('TechDocsStorageClient', () => { const promise = storageApi.syncEntityDocs(mockEntity).then(); // flush the event loop - await new Promise(setImmediate); + await new Promise(r => setTimeout(r)); const instance = MockedEventSource.mock .instances[0] as jest.Mocked; @@ -248,7 +248,7 @@ describe('TechDocsStorageClient', () => { const promise = storageApi.syncEntityDocs(mockEntity).then(); // flush the event loop - await new Promise(setImmediate); + await new Promise(r => setTimeout(r)); const instance = MockedEventSource.mock .instances[0] as jest.Mocked;