chore: more test extraction to vitest & handle any#1025
Open
ferhatelmas wants to merge 1 commit intomasterfrom
Open
chore: more test extraction to vitest & handle any#1025ferhatelmas wants to merge 1 commit intomasterfrom
ferhatelmas wants to merge 1 commit intomasterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR continues the ongoing migration of unit tests from Jest to Vitest (keeping src/test/** as Jest-run integration tests), while tightening typing in a few test helpers to avoid any.
Changes:
- Migrates multiple existing unit test suites to Vitest APIs (
vi.*) and updates mocking patterns (includingvi.hoisted,vi.doMock, and module reset flows). - Moves the
escapeLikeunit test out of Jest integration tests into a new Vitest unit test colocated with the implementation. - Adds new Vitest unit tests for database SSL utilities and a migration SQL transformer.
Reviewed changes
Copilot reviewed 13 out of 15 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/test/search-filters.test.ts | Removes escapeLike unit assertions from Jest integration tests (to be covered under Vitest). |
| src/storage/database/knex.test.ts | Adds a new Vitest unit test for escapeLike. |
| src/storage/scanner/scanner-pagination.test.ts | Converts scanner pagination regression test from Jest mocks to vi. |
| src/storage/protocols/vector/vector-store.test.ts | Converts vector store manager tests to Vitest and replaces any-style bucket records with a typed helper. |
| src/storage/events/migrations/run-migrations.test.ts | Converts migration job tests to Vitest, using vi.hoisted for stable mock references. |
| src/storage/backend/s3/adapter.test.ts | Converts S3 backend tests to Vitest and replaces any-typed upload mock plumbing with explicit shapes. |
| src/storage/backend/file.test.ts | Converts file backend tests to Vitest and updates mock/spy usage accordingly. |
| src/scripts/orphan-client-stream.test.ts | Converts script unit tests to Vitest (vi.spyOn / restore flow). |
| src/internal/queue/event.test.ts | Converts queue/event payload versioning tests to Vitest and adjusts module import paths. |
| src/internal/monitoring/otel-tracing.test.ts | Converts OTel tracing bootstrap tests to Vitest and improves module unmock cleanup between tests. |
| src/internal/monitoring/otel-metrics.test.ts | Converts OTel metrics bootstrap tests to Vitest and improves module unmock/reset cleanup between tests. |
| src/internal/database/ssl.test.ts | Adds new Vitest unit tests for getSslSettings and isIpAddress. |
| src/internal/database/migrations/transformers/disable-concurrent-index-transformer.test.ts | Adds new Vitest unit tests for the concurrent-index disabling transformer. |
| src/internal/database/migrations/progressive.test.ts | Converts progressive migrations tests to Vitest with vi.hoisted mocks. |
| src/internal/cache/monitoring.test.ts | Converts cache monitoring tests to Vitest timers/spies (vi.useFakeTimers, vi.spyOn, etc.). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: ferhat elmas <elmas.ferhat@gmail.com>
ad99e3e to
455f396
Compare
Coverage Report for CI Build 24481025295Coverage decreased (-0.06%) to 82.415%Details
Uncovered ChangesNo uncovered changes found. Coverage Regressions11 previously-covered lines in 5 files lost coverage.
Coverage Stats💛 - Coveralls |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce?
chore
What is the current behavior?
Tests are run by jest.
What is the new behavior?
Extract more unit tests to run by vitest. Handle any.
Additional context
Reducing scope of #922