Hey there! I am using the typesense-js client to m...
# community-help
p
Hey there! I am using the typesense-js client to make requests and i want to test my react component with mock data. Are you aware of any way to intercept the typesense request through the client and return stubbed data? Maybe an example with jest?
j
typesense-js uses
axios
, so you can use
axios-mock-adapter
to mock responses.
p
thanks for the answer. The api call though happens in my component which i render in my test using react-testing-library. Will it manage to intercept it?
j
I think it will…
p
you re the best! thanks
😄 1
👍 1