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

Update index.ts of jest addon to make withTests type generic #8410

Merged
merged 2 commits into from Oct 14, 2019

Conversation

CodeByAlex
Copy link
Member

Issue: #8058

What I did

Update index.ts of jest addon to make withTests type generic

How to test

  • Is this testable with Jest or Chromatic screenshots? no
  • Does this need a new example in the kitchen sink apps? no
  • Does this need an update to the documentation? no

If your answer is yes to any of these, please make sure to include it in your PR.

@vercel
Copy link

vercel bot commented Oct 13, 2019

This pull request is being automatically deployed with ZEIT Now (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://zeit.co/storybook/monorepo/9sx4eomxp
🌍 Preview: https://monorepo-git-jest-with-tests-type-fix.storybook.now.sh

@shilman
Copy link
Member

shilman commented Oct 14, 2019

@CodeByAlex how do I test this?

@kroeder
Copy link
Member

kroeder commented Oct 14, 2019

The error that appears in the related issue is Argument of type 'DecoratorFunction<unknown>' is not assignable to parameter of type 'StoryDecorator'.

Making it any fixes the issue I guess. But maybe it should have been of type StoryDecorator in the first place? Or are there other use-cases?

@CodeByAlex
Copy link
Member Author

Yeah, thats right @kroeder - I was thinking that there may be other use cases and didn't want to cause the same issues that we saw with making knobs strict. If you think it would be fine setting the type to StoryDecorator, I can change it to that.

@kroeder
Copy link
Member

kroeder commented Oct 14, 2019

We could add tests for all possible inputs. That's the easiest way to ensure typings are correct I guess
But if any fixes the issue we can do that and raise another issue with "improve typings for addon-jest"

@shilman shilman changed the title Update index.ts of jest addon to make withTests type generic Addon-jest: Make withTests type generic Oct 14, 2019
@shilman shilman added this to the 5.2.x milestone Oct 14, 2019
@shilman shilman added the patch:yes Bugfix & documentation PR that need to be picked to main branch label Oct 14, 2019
@shilman shilman changed the title Addon-jest: Make withTests type generic Update index.ts of jest addon to make withTests type generic Oct 14, 2019
@shilman shilman merged commit 4c91a1c into next Oct 14, 2019
@shilman shilman deleted the jest-with-tests-type-fix branch October 14, 2019 17:20
@shilman shilman added the patch:done Patch/release PRs already cherry-picked to main/release branch label Oct 22, 2019
shilman added a commit that referenced this pull request Oct 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addon: jest bug patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch typescript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants