Skip to content

Commit

Permalink
Merge pull request #29751 from storybookjs/norbert/vitest-coverage-er…
Browse files Browse the repository at this point in the history
…ror-reporting-improvements

AddonTest: Error reporting for `vitest` crashes
  • Loading branch information
ndelangen authored Dec 2, 2024
2 parents 08e5a54 + 35714f8 commit 0fe1043
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion code/addons/test/src/node/vitest-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,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();
Expand Down
2 changes: 1 addition & 1 deletion code/core/src/manager/components/sidebar/SidebarBottom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 0fe1043

Please sign in to comment.