Skip to content

refactor: replace chai and sinon with native vitest assertions#590

Merged
merencia merged 1 commit into
mainfrom
refactor/vitest-native-assertions
Jun 25, 2026
Merged

refactor: replace chai and sinon with native vitest assertions#590
merencia merged 1 commit into
mainfrom
refactor/vitest-native-assertions

Conversation

@merencia

Copy link
Copy Markdown
Member

Summary

  • Migrate all 39 test files from chai assert/expect to vitest native expect()
  • Replace sinon stubs/spies with vi.fn() and vi.spyOn() (2 files: background-scheduled-task.test.ts, logger.test.ts)
  • Remove chai, sinon, @types/chai, @types/sinon from devDependencies (-4 deps)

Why

vitest already provides expect() and vi.fn() out of the box. The extra dependencies added install weight and forced contributors to learn two assertion APIs.

Test plan

  • All 628 tests pass
  • Zero remaining imports of chai or sinon
  • Packages uninstalled, tests still pass without them

Migrate all 39 test files from chai assert/expect to vitest expect(),
and replace sinon stubs with vi.fn()/vi.spyOn(). Remove chai, sinon,
@types/chai, and @types/sinon from devDependencies.
@merencia merencia merged commit d29d07a into main Jun 25, 2026
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.

1 participant