Skip to content

Reorganise repo to use vitest instead of jest#387

Merged
tsmith023 merged 15 commits intomainfrom
chore/migrate-to-vitest
Jan 20, 2026
Merged

Reorganise repo to use vitest instead of jest#387
tsmith023 merged 15 commits intomainfrom
chore/migrate-to-vitest

Conversation

@tsmith023
Copy link
Collaborator

@tsmith023 tsmith023 commented Jan 19, 2026

This PR refactors and reorganises the repository to better isolate tests from the source of the package while also migrating from jest to vitest. In doing so, it also bumps dependencies, e.g. of typescript, and removes unused/outdated packages. Any issues in the src found through the test refactoring are also fixed.

Copy link

@orca-security-eu orca-security-eu bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Infrastructure as Code high 0   medium 0   low 0   info 0 View in Orca
Passed Passed SAST high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Vulnerabilities high 0   medium 0   low 0   info 0 View in Orca

@tsmith023 tsmith023 changed the title Replace jest with vitest everywhere Reorganise repo to use vitest instead of jest Jan 20, 2026
@tsmith023 tsmith023 marked this pull request as ready for review January 20, 2026 12:20
@tsmith023 tsmith023 requested a review from a team as a code owner January 20, 2026 12:20
@tsmith023 tsmith023 requested a review from bevzzz January 20, 2026 12:22
@bevzzz
Copy link
Collaborator

bevzzz commented Jan 20, 2026

reorganises the repository to better isolate tests from the source of the package

opinion (non-blocking): I don't know that this is necessarily an improvement for unit tests.
Those, I feel, should serve as "documentation" for the code they're testing and many modern languages encourage keeping them close (Go with thing.go and thing_test.go) or even in the same source file (Rust / Zig)

Integration tests are a different beast, so no objections there.

@tsmith023
Copy link
Collaborator Author

tsmith023 commented Jan 20, 2026

I don't know that this is necessarily an improvement for unit tests.

I was going to leave the unit tests in src/ to begin with but went with this for "consistency". Since you've raised this independently, I'll move the unit tests back. With the vitest.config.ts file, this is trivial to do anyway!

- change `unit.test.ts` files including mocks to `mock.test.ts`
- add `mock.test.ts` to `integration` project
@tsmith023 tsmith023 merged commit 5631379 into main Jan 20, 2026
18 checks passed
@tsmith023 tsmith023 deleted the chore/migrate-to-vitest branch January 20, 2026 16:47
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