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

feat: allow string responses #201

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

sr258
Copy link

@sr258 sr258 commented Nov 23, 2023

I've added the support for returning a string value in a response instead of only allowing JSON. Adding the change to the Storybook docs in packages/mock-addon-docs requires some bigger changes in the test files, so I haven't done that yet because I wanted to wait for your feedback on whether you want to accept the PR and if so, how it should be added to the docs.

Closes #200 .

Copy link

netlify bot commented Nov 23, 2023

Deploy Preview for storybook-addon-mock ready!

Name Link
🔨 Latest commit e8307ab
🔍 Latest deploy log https://app.netlify.com/sites/storybook-addon-mock/deploys/655f82af6bf56c0008a707f0
😎 Deploy Preview https://deploy-preview-201--storybook-addon-mock.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@Mattsi-Jansky
Copy link

I would love this feature. It is quite a severe limitation to only be able to return objects and arrays. Hope the PR gets merged

@basvk
Copy link

basvk commented Oct 18, 2024

Nice, I hope this gets merged. There's still a small issue though: when using fetchXhrRequest it still uses JSON.stringify on a string response, causing it to become double quoted.
I've solved it like this: basvk@2c6db91 .

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.

Support string responses
3 participants