Skip to content

Commit

Permalink
use exportName as fallback for test title instead
Browse files Browse the repository at this point in the history
  • Loading branch information
yannbf committed Oct 1, 2024
1 parent 192622c commit d23542f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion code/core/src/csf-tools/vitest-plugin/transformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ export async function vitestTransform({

const localName = parsed._stories[exportName].localName ?? exportName;
// use the story's name as the test title for vitest, and fallback to exportName
const testTitle = parsed._stories[exportName].name ?? localName;
const testTitle = parsed._stories[exportName].name ?? exportName;
return getTestStatementForStory({ testTitle, localName, exportName, node });
})
.filter((st) => !!st) as t.ExpressionStatement[];
Expand Down

0 comments on commit d23542f

Please sign in to comment.