Skip to content

How can I mock a module that only provides type definitions? #7228

Answered by sheremet-va
mysticfall asked this question in Q&A
Discussion options

You must be logged in to vote

This is just how Vite works. To make Vite aware of this module and not fail during transformation, define an alias. More in docs: https://vitest.dev/guide/mocking.html#virtual-modules

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@mysticfall
Comment options

@mysticfall
Comment options

@sheremet-va
Comment options

Answer selected by mysticfall
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants