Skip to content

Add vitest test framework with SDK tests#3

Merged
marcqualie merged 2 commits into
mainfrom
vitest
Feb 23, 2026
Merged

Add vitest test framework with SDK tests#3
marcqualie merged 2 commits into
mainfrom
vitest

Conversation

@marcqualie

Copy link
Copy Markdown
Member

Summary

  • Add vitest as the test framework, wired up through turbo with a pnpm test script
  • Add request.test.ts with 14 tests covering the raw request() 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 passthrough
  • Add scans.test.ts with 11 tests covering client setup (default/custom baseUrl), request layer integration (auth header, error throwing), and endpoint wiring for client.v1.vitals.scans (create, list with query params, retrieve)
  • Add pnpm test step to CI workflow

Test plan

  • pnpm test passes (25 tests across 2 files)
  • pnpm lint passes
  • CI runs tests in GitHub Actions

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 marcqualie self-assigned this Feb 23, 2026
@marcqualie
marcqualie marked this pull request as ready for review February 23, 2026 15:19
@marcqualie
marcqualie merged commit 7b8e087 into main Feb 23, 2026
1 check passed
@marcqualie
marcqualie deleted the vitest branch February 23, 2026 15:34
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