Skip to content

test: migrate from mocha/sinon/chai to vitest - #218

Merged
dantio merged 1 commit into
hendt:masterfrom
jostrander:jostrander/vitest-migration
Aug 1, 2026
Merged

test: migrate from mocha/sinon/chai to vitest#218
dantio merged 1 commit into
hendt:masterfrom
jostrander:jostrander/vitest-migration

Conversation

@jostrander

Copy link
Copy Markdown
Contributor

Replace .mocharc.json with vitest.config.ts, sinon stubs with vi.fn(), and chai matchers with vitest equivalents. Bump @types/node to ^22 to satisfy vitest 4's peer range.

Tighten 11 tests that asserted inside try/catch or .catch() and passed without ever running their assertion. This exposed three stale checks: the IAF token expiry fixture was missing Failure so it never threw, and the factory and digitalSignature regexes hid the real error messages.

Replace .mocharc.json with vitest.config.ts, sinon stubs with vi.fn(),
and chai matchers with vitest equivalents. Bump @types/node to ^22 to
satisfy vitest 4's peer range.

Tighten 11 tests that asserted inside try/catch or .catch() and passed
without ever running their assertion. This exposed three stale checks:
the IAF token expiry fixture was missing <Ack>Failure</Ack> so it never
threw, and the factory and digitalSignature regexes hid the real error
messages.
@dantio
dantio merged commit f0e47b0 into hendt:master Aug 1, 2026
1 check passed
@jostrander
jostrander deleted the jostrander/vitest-migration branch August 1, 2026 16:22
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