Skip to content

Commit

Permalink
Ensure that exported variables get handled properly as stories
Browse files Browse the repository at this point in the history
  • Loading branch information
shilman committed Dec 1, 2021
1 parent 9a52fca commit 099b19c
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions lib/csf-tools/src/CsfFile.test.ts
Expand Up @@ -46,6 +46,32 @@ describe('CsfFile', () => {
`);
});

it('exported const stories', () => {
expect(
parse(
dedent`
export default { title: 'foo/bar' };
const A = () => {};
const B = (args) => {};
export { A, B };
`,
true
)
).toMatchInlineSnapshot(`
meta:
title: foo/bar
stories:
- id: foo-bar--a
name: A
parameters:
__id: foo-bar--a
- id: foo-bar--b
name: B
parameters:
__id: foo-bar--b
`);
});

it('underscores', () => {
expect(
parse(
Expand Down

0 comments on commit 099b19c

Please sign in to comment.