storybookjs / testing-vue3

Testing utilities that allow you to reuse your stories in your unit tests
16 stars 9 forks source link

composeStories() ignores excludeStories #11

Closed oliver-heeger closed 1 year ago

oliver-heeger commented 1 year ago

If you have a named Export in a CSF Story, tests will fail, even if it is excluded with excludeStories: /.*Props$/:

export const PrimaryProps: ButtonType = {
  size: 'medium',
  variant: 'primary',
  text: 'my happy primary button',
}
export const Primary = Template.bind({})
Primary.args = PrimaryProps

Error: Cannot compose story due to invalid format. @storybook/testing-vue expected a function but received object instead.

https://storybook.js.org/docs/react/api/csf#non-story-exports

yannbf commented 1 year ago

Hey there, this is now supported in version 1.0.0 of this package. Keep in mind that it requires Storybook 7.0.0!