From bcd77d07fd575e18f224682a2e5c0be404c35e72 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Fri, 29 Nov 2024 14:37:42 +0100 Subject: [PATCH] error reporting for vitest crashes --- code/addons/test/src/node/vitest-manager.ts | 6 +++++- code/core/src/manager/components/sidebar/SidebarBottom.tsx | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/code/addons/test/src/node/vitest-manager.ts b/code/addons/test/src/node/vitest-manager.ts index 8329b091e70f..5cf7b54dd4a2 100644 --- a/code/addons/test/src/node/vitest-manager.ts +++ b/code/addons/test/src/node/vitest-manager.ts @@ -73,7 +73,11 @@ export class VitestManager { }); } - await this.vitest.init(); + try { + await this.vitest.init(); + } catch (e) { + this.testManager.reportFatalError('Failed to init Vitest', e); + } if (watchMode) { await this.setupWatchers(); diff --git a/code/core/src/manager/components/sidebar/SidebarBottom.tsx b/code/core/src/manager/components/sidebar/SidebarBottom.tsx index ba64b4e500a5..871821ebf208 100644 --- a/code/core/src/manager/components/sidebar/SidebarBottom.tsx +++ b/code/core/src/manager/components/sidebar/SidebarBottom.tsx @@ -122,7 +122,7 @@ export const SidebarBottomBase = ({ useEffect(() => { const onCrashReport = ({ providerId, ...details }: TestingModuleCrashReportPayload) => { api.updateTestProviderState(providerId, { - details, + error: { name: 'Crashed!', message: details.error.message }, running: false, crashed: true, watching: false,