From e7a0b8a4efecc7d311a42f907a82ba69a8e802f5 Mon Sep 17 00:00:00 2001 From: Ondrej Dockal Date: Mon, 22 Apr 2024 12:42:28 +0200 Subject: [PATCH] chore: make sure to run webview-preload init when running e2e tests (#6842) * chore: webview-preload init not called on unit tests only Signed-off-by: Florent Benoit --------- Signed-off-by: Ondrej Dockal --- packages/preload-webview/src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/preload-webview/src/index.ts b/packages/preload-webview/src/index.ts index 75459e7ecf1..ed9fd861ece 100644 --- a/packages/preload-webview/src/index.ts +++ b/packages/preload-webview/src/index.ts @@ -35,7 +35,7 @@ export const init = (): void => { webviewPreload.init().catch((error: unknown) => console.error('Error while initializing the exposure', error)); }; -// do not call init methd in case of testing -if (!process.env.VITEST) { +// do not call init method in case of testing +if (import.meta.env.MODE !== 'test') { init(); }