Comments (7)
Hi @lukvermeulen! Facing the same issue with send XHR through superagent. Did you find solution? Or used something else?
from storybook-addon-mock.
Hey @GunsStarR, I ended up using "Mock Service Worker", after following this article. It works quite well for me.
from storybook-addon-mock.
@lukvermeulen I tried to run swr with storybook-addon-mock
and it works properly. I have used their basic example for testing.
Looking at your code, can you tell me which type of client is this? is it going to call a fetch or XHR request?
const channelsFetcher = () => {
return client
.service("channels")
.find()
.then((res) => {
return res.data;
});
};
from storybook-addon-mock.
@GunsStarR it's confirmed that there's a bug in the package which breaks the superagent. You will get the fix in the upcoming release.
from storybook-addon-mock.
@GunsStarR this fix is released in version 2.4.0. Can you please check?
from storybook-addon-mock.
Hi @nutboltu, my client is configured to use native window.fetch
from storybook-addon-mock.
I'm using swr
along with axios
in a custom fetcher and also experiencing issues. I posted a detailed comment in another issue about relative URLs here.
I'm using version 2.4.1
.
from storybook-addon-mock.
Related Issues (20)
- [Feature] Should be able to abort fetch requests HOT 1
- XMLHttpRequest is not properly reflected when there's no mock matched HOT 12
- Scope mockData to each story
- Addon fails in Yarn pnp projects HOT 3
- getting blank pages when navigating around storybook after adding the mock addon HOT 3
- `forEach` and other properties missing from response headers HOT 3
- Not properly mocking requests made with ofetch HOT 2
- Undeclared dependency on `prop-types` HOT 1
- No apparent way to mock NextJs internal API calls
- panel content not scrollable HOT 3
- Support string responses
- Unable to `ignoreQueryParams` per request basis HOT 1
- Disabling the addon for specific story causes an error
- Problem with mocking N requests of one type [GET]. HOT 1
- Enabling this addon interferes with `vue-advanced-cropper`
- Storybook 8 compatibility HOT 13
- Mocking SVG Get Request
- error after updating to storybook 8 HOT 1
- Support for differentiating URL HOT 1
- [5.0.0] Interferes with URL.createObjectURL
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from storybook-addon-mock.