Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(logging): allow configuring the mock function used #5728

Merged
merged 2 commits into from
Dec 11, 2024

Conversation

eventualbuddha
Copy link
Collaborator

Overview

Refs #5725

Unblocks converting packages that use @votingworks/logging's mock factories.

Demo Video or Screenshot

// jest by default
const logger = mockLogger();

// vitest by request
const logger = mockLogger({ fn: vi.fn });

Testing Plan

Converted libs/db, which uses mockBaseLogger, to use vi.fn.

@eventualbuddha eventualbuddha merged commit 5311a0d into vitest Dec 11, 2024
1 of 62 checks passed
@eventualbuddha eventualbuddha deleted the 5725-libslogging branch December 11, 2024 21:43
eventualbuddha added a commit that referenced this pull request Dec 12, 2024
* refactor(logging): overload `mockLogger` with options objects

This will make it easier to provide a mock function.

* feat(logging): allow configuring the mock function used
eventualbuddha added a commit that referenced this pull request Dec 19, 2024
* refactor(logging): overload `mockLogger` with options objects

This will make it easier to provide a mock function.

* feat(logging): allow configuring the mock function used
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