We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I need to mock a fetch call, which returns a pdf.
Not sure who to do that. I've already tried some stuff like:
fetchMocker.mockResponseOnce(await readFile(path));
The text was updated successfully, but these errors were encountered:
I haven't tried this yet, but I think it should be something like:
import { readFile } from 'node:fs/promises'; const buffer = await readFile("path/to/file"); fetchMocker. mockResponseOnce(new Response(new Blob([buffer])));
Sorry, something went wrong.
No branches or pull requests
I need to mock a fetch call, which returns a pdf.
Not sure who to do that. I've already tried some stuff like:
The text was updated successfully, but these errors were encountered: