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

fix: Make Mentoss work in Bun #36

Merged
merged 2 commits into from
Feb 5, 2025
Merged

fix: Make Mentoss work in Bun #36

merged 2 commits into from
Feb 5, 2025

Conversation

nzakas
Copy link
Contributor

@nzakas nzakas commented Feb 5, 2025

This pull request implements changes to make Mentoss work in Bun. To do so, I had to workaround a couple of bugs that are present in Bun's fetch implementation:

oven-sh/bun#17052
oven-sh/bun#17085

Improvements to fetch requests:

  • src/fetch-mocker.js: Added a workaround to handle Bun's fetch implementation that sets credentials to "include" by default and doesn't allow overwriting that value when creating a Request.

Improvements to tests:

  • tests/fetch-mocker.test.js: Simplified the error message assertion in the FetchMocker test to use a regular expression instead of an object.
  • tests/mock-server.test.js: Set the default content type to "text/plain;charset=UTF-8" for non-JSON request bodies in the createRequest function.

@nzakas nzakas merged commit d3e1e4b into main Feb 5, 2025
24 checks passed
@nzakas nzakas deleted the bun branch February 5, 2025 22:03
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.

1 participant