Skip to content

Conversation

@yamachi4416
Copy link
Contributor

@yamachi4416 yamachi4416 commented Sep 14, 2025

πŸ”— Linked issue

resolves #1261
It might work if you specify fetch in the adapter.

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

I tried to make registerEndpoint support mocking native fetch.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Sep 14, 2025

Open in StackBlitz

npm i https://pkg.pr.new/@nuxt/test-utils@1415

commit: 22aa665

@yamachi4416 yamachi4416 force-pushed the native-fetch-endpoint-mock branch 2 times, most recently from 06b41d4 to 5225e00 Compare September 14, 2025 00:57
@yamachi4416
Copy link
Contributor Author

The tests pass with happy-dom, but with jsdom the tests fail because Request is not supported. How should I handle this...

@yamachi4416 yamachi4416 force-pushed the native-fetch-endpoint-mock branch 2 times, most recently from a4f0c91 to 6fd1b45 Compare September 17, 2025 23:25
@yamachi4416 yamachi4416 changed the title fix(runtime): allow registerEndpoint to work with native fetch feat(runtime): allow registerEndpoint to work with native fetch Sep 17, 2025
@yamachi4416
Copy link
Contributor Author

Thank you for letting me use this all the time. I think it’s now ready for your review. Sorry if my first pull request is a bit clumsy. I’d appreciate it if you could review it.

@yamachi4416 yamachi4416 force-pushed the native-fetch-endpoint-mock branch from 6fd1b45 to 7466d77 Compare October 18, 2025 11:07
Copy link
Member

@danielroe danielroe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

amazing - thank you! ❀️

@danielroe danielroe merged commit 879f25c into nuxt:main Oct 23, 2025
7 checks passed
@github-actions github-actions bot mentioned this pull request Oct 23, 2025
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.

registerEndpoint does not work for axios

2 participants