Skip to content

Conversation

@mcous
Copy link
Owner

@mcous mcous commented Nov 4, 2024

Overview

As discussed in #15 (comment), this PR makes a slight adjustment to the mockImplementation added by vitest-when. Rather than returning undefined in the case of a miss, it will use whatever mockImplementation already existed on the spy prior to when usage.

This will keep the default undefined return in normal usage, but allow for the configuration of unconditional default implementations, which may be helpful in specific cases.

Closes #15

Change log

@mcous mcous changed the title feat: fallback to original mockImplementation if no match feat: fallback to original mockImplementation if no match Nov 4, 2024
@mcous mcous merged commit 5cd3283 into main Nov 4, 2024
@mcous mcous deleted the feat/fallback branch November 4, 2024 16:24
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.

Allow use with mocks created by spyOn

2 participants