Skip to content

feat(runtime-utils): support mocked target arguments in mockNuxtImport#1492

Merged
danielroe merged 1 commit intonuxt:mainfrom
yamachi4416:feat/mockNuxtImportSupportMockedTargetArg
Dec 4, 2025
Merged

feat(runtime-utils): support mocked target arguments in mockNuxtImport#1492
danielroe merged 1 commit intonuxt:mainfrom
yamachi4416:feat/mockNuxtImportSupportMockedTargetArg

Conversation

@yamachi4416
Copy link
Copy Markdown
Collaborator

@yamachi4416 yamachi4416 commented Nov 23, 2025

🔗 Linked issue

❓ 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

the following syntax using the mockNuxtImport macro

mockNuxtImport<typeof useAutoImportedTarget>('useAutoImportedTarget', () => {
  return () => 'mocked!'
})

will be replaceable by the following form

mockNuxtImport(useAutoImportedTarget, () => {
  return () => 'mocked!'
})

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Nov 23, 2025

Open in StackBlitz

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

commit: 0cef851

@yamachi4416 yamachi4416 marked this pull request as ready for review November 23, 2025 13:17
Copy link
Copy Markdown
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.

nice! ❤️

@danielroe danielroe merged commit b6179fd into nuxt:main Dec 4, 2025
7 checks passed
This was referenced Dec 4, 2025
@yamachi4416 yamachi4416 deleted the feat/mockNuxtImportSupportMockedTargetArg branch December 5, 2025 10:25
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.

2 participants