Skip to content

Conversation

Thomaash
Copy link
Contributor

It's not necessary to define all slots, pratially defined slots are used all over the place throughout the tests here and routinely by users. However, the type for slots in mount options was not partiall and that caused type errors for people using noUncheckedIndexedAccess: true even though it work fine in runtime. Adding ? doesn't change anything for users with noUncheckedIndexedAccess: false, it has passed type checking before and will continue to pass. Type checking will now also pass for users with partially defined slots using noUncheckedIndexedAccess: true.

…s true

It's not necessary to define all slots, pratially defined slots are used
all over the place throughout the tests here and routinely by users.
However, the type for slots in mount options was not partiall and that
caused type errors for people using `noUncheckedIndexedAccess: true`
even though it work fine in runtime. Adding `?` doesn't change anything
for users with `noUncheckedIndexedAccess: false`, it has passed type
checking before and will continue to pass. Type checking will now also
pass for users with partially defined slots using
`noUncheckedIndexedAccess: true`.
Copy link

netlify bot commented Sep 19, 2025

Deploy Preview for vue-test-utils-docs ready!

Name Link
🔨 Latest commit 416c2c3
🔍 Latest deploy log https://app.netlify.com/projects/vue-test-utils-docs/deploys/68cd33bfff4d6600085be6f6
😎 Deploy Preview https://deploy-preview-2713--vue-test-utils-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Member

@cexbrayat cexbrayat left a comment

Choose a reason for hiding this comment

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

Could you add a test in https://github.com/vuejs/test-utils/tree/main/test-dts to repro what you're trying to do? You can probably enable the option in https://github.com/vuejs/test-utils/blob/main/test-dts/tsconfig.tsd.json

@Thomaash
Copy link
Contributor Author

I added the missing test

@cexbrayat cexbrayat merged commit e82e8fb into vuejs:main Sep 19, 2025
7 checks passed
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