Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add story kind regex #906

Merged
merged 2 commits into from
Apr 16, 2017
Merged

Conversation

olistic
Copy link
Contributor

@olistic olistic commented Apr 16, 2017

Issue: #892

What I did

  • Added storyKindRegex to filter stories based on the story's kind.
  • Renamed storyRegex to storyNameRegex, but preserved backward compatibility (let me know if this is no longer required).
  • Updated documentation to reflect changes.

How to test

  • Create a basic storybook and:
    • Check storyRegex still works.
    • Check storyNameRegex behaves the same as storyRegex.
    • Check storyKindRegex only runs stories which kind matches the regex.

@shilman
Copy link
Member

shilman commented Apr 16, 2017

Thanks @olistic. Will review and merge today!

@shilman shilman self-assigned this Apr 16, 2017
@@ -53,11 +53,18 @@ export default function testStorySnapshots(options = {}) {
const suit = options.suit || 'Storyshots';
const stories = storybook.getStorybook();

// Added not to break existing storyshots configs (can be removed in a future major release)
options.storyNameRegex = options.storyNameRegex || options.storyRegex;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome. We are planning a major release soon! @ndelangen we should set up a place to track breaking changes

@shilman
Copy link
Member

shilman commented Apr 16, 2017

@ndelangen these errors are not related to this change. I'm merging it now because this is a PR I closed on the storyshots repo yesterday as part of the cleanup, and I want to get it done.

@shilman shilman merged commit 5dca790 into storybookjs:master Apr 16, 2017
@olistic olistic deleted the add-story-kind-regex branch April 19, 2017 01:44
@shilman shilman added the misc label May 27, 2017
@ecbrodie
Copy link

@olistic @shilman I am going through my project's upgrade from Storybook to Storyshots and I ran into this hard deprecation (ie, the storyRegex key being removed and being forced to switch to storyNameRegex). I tried scanning CHANGELOG.md for any breaking change note about this renaming, but found nothing. It would be nice to have some sort of documentation about this breaking change. Maybe I missed it, does such a note exist? If not, are you okay with having this added to CHAGNELOG.md to help save time for other developers like myself going through a Storybook/Storyshots upgrade? Thank you.

@igor-dv
Copy link
Member

igor-dv commented Dec 25, 2018

@ecbrodie, sure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants