Add vitest test framework with SDK tests#3
Merged
Merged
Conversation
Set up vitest as the test framework across the monorepo with a turbo task and CI integration. Add a test for client.v1.vitals.scans.create() that mocks fetch to verify the correct URL, method, headers, and body are passed through to the API without making network requests.
Add dedicated tests for the raw request() function covering response parsing (valid JSON, error payloads, empty bodies, malformed JSON), error handling (4xx, 5xx, network errors with status/message), URL construction (path building, query params, undefined param omission), and header passthrough. Expand scans.test.ts with client setup tests (default/custom baseUrl), request layer integration tests (auth header, error throwing), and full endpoint coverage for list (with query params), retrieve, and create.
marcqualie
marked this pull request as ready for review
February 23, 2026 15:19
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.
Summary
pnpm testscriptrequest.test.tswith 14 tests covering the rawrequest()function: response parsing (valid JSON, error payloads, empty bodies, malformed JSON), error handling (4xx, 5xx, network errors), URL construction (path building, query params, undefined param filtering), and header passthroughscans.test.tswith 11 tests covering client setup (default/custom baseUrl), request layer integration (auth header, error throwing), and endpoint wiring forclient.v1.vitals.scans(create, list with query params, retrieve)pnpm teststep to CI workflowTest plan
pnpm testpasses (25 tests across 2 files)pnpm lintpasses