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

Core: Mock channel if not present #17382

Merged
merged 1 commit into from
Feb 2, 2022

Conversation

yannbf
Copy link
Member

@yannbf yannbf commented Feb 1, 2022

Issue: N/A

What I did

Currently when the channel is accessed via addons outside of a browser environment (e.g. tests with testing-react), the following error is thrown:

Error: Uncaught [Error: Accessing non-existent addons channel, see https://storybook.js.org/basics/faq/#why-is-there-no-addons-channel]

This PR sets a mock automatically so users don't have to. I'm not sure about all implications of this change so @tmeasday I'd love if you could check this out!

How to test

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

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

@yannbf yannbf added the core label Feb 1, 2022
@nx-cloud
Copy link

nx-cloud bot commented Feb 1, 2022

☁️ Nx Cloud Report

CI ran the following commands for commit d007158. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

@yannbf yannbf added the linear label Feb 1, 2022
@tmeasday
Copy link
Member

tmeasday commented Feb 2, 2022

Seems like a decent solution to me @yannbf. Not sure if this would be considered a breaking change (I vote no!), but it certainly may have implications we aren't aware of. I say we find out what they are!

Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

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

Scary! LGTM 😅

@shilman shilman changed the title feat(addons): mock channel if not present Core: Mock channel if not present Feb 2, 2022
@shilman shilman merged commit 6e74df5 into next Feb 2, 2022
@shilman shilman deleted the fix/do-not-throw-missing-channel-error branch February 2, 2022 06:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants