Skip to content

refactor(sdk): colocate vitest tests next to their sources#1194

Open
toiroakr wants to merge 1 commit into
mainfrom
refactor/colocate-vitest-tests
Open

refactor(sdk): colocate vitest tests next to their sources#1194
toiroakr wants to merge 1 commit into
mainfrom
refactor/colocate-vitest-tests

Conversation

@toiroakr
Copy link
Copy Markdown
Contributor

Summary

  • Drop packages/sdk/src/vitest/__tests__/ and place each test file next to the module it covers.
  • Drop the **/__tests__/**/*.ts entry from vitest.config.ts since the standard **/?(*.)+(spec|test).ts include pattern already picks up the relocated files.
  • Move the nested integration runner from src/vitest/__tests__/integration/ to src/vitest/integration/ and add src/vitest/integration/vitest.config.ts to knip.json's ignore list so the dynamically-spawned config is not flagged as unused.
  • Pure refactor — no public API or runtime behavior changes; existing imports continue to resolve.

Drop the `src/vitest/__tests__/` directory; the test files live next
to the modules they cover. Vitest discovers them via the existing
`**/?(*.)+(spec|test).ts` include pattern, so the
`**/__tests__/**/*.ts` entry has been removed from
`vitest.config.ts`. The nested integration runner moves from
`src/vitest/__tests__/integration/` to `src/vitest/integration/`.

Pure refactor: no public API or behavior changes.
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 19, 2026

🦋 Changeset detected

Latest commit: 4c227cc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@tailor-platform/sdk Patch
@tailor-platform/create-sdk Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 19, 2026

⚡ pkg.pr.new

@tailor-platform/sdk

pnpm add https://pkg.pr.new/@tailor-platform/sdk@4c227cc
pnpm dlx https://pkg.pr.new/@tailor-platform/sdk@4c227cc --help

@tailor-platform/create-sdk

pnpm add https://pkg.pr.new/@tailor-platform/create-sdk@4c227cc
pnpm dlx https://pkg.pr.new/@tailor-platform/create-sdk@4c227cc my-app

commit: 4c227cc

@github-actions
Copy link
Copy Markdown

Code Metrics Report (packages/sdk)

main (d3d984f) #1194 (478793a) +/-
Coverage 61.9% 61.9% 0.0%
Code to Test Ratio 1:0.4 1:0.4 0.0
Details
  |                    | main (d3d984f) | #1194 (478793a) | +/-  |
  |--------------------|----------------|-----------------|------|
  | Coverage           |          61.9% |           61.9% | 0.0% |
  |   Files            |            363 |             363 |    0 |
  |   Lines            |          12651 |           12651 |    0 |
  |   Covered          |           7833 |            7833 |    0 |
  | Code to Test Ratio |          1:0.4 |           1:0.4 |  0.0 |
  |   Code             |          82915 |           82915 |    0 |
  |   Test             |          34645 |           34645 |    0 |

SDK Configure Bundle Size

main (d3d984f) #1194 (478793a) +/-
configure-index-size 17KB 17KB 0KB
dependency-chunks-size 34.43KB 34.43KB 0KB
total-bundle-size 51.43KB 51.43KB 0KB

Runtime Performance

main (d3d984f) #1194 (478793a) +/-
Generate Median 3,036ms 2,311ms -725ms
Generate Max 3,076ms 2,661ms -415ms
Apply Build Median 3,077ms 2,334ms -743ms
Apply Build Max 3,126ms 2,349ms -777ms

Type Performance (instantiations)

main (d3d984f) #1194 (478793a) +/-
tailordb-basic 35,130 35,130 0
tailordb-optional 3,841 3,841 0
tailordb-relation 7,428 7,428 0
tailordb-validate 2,566 2,566 0
tailordb-hooks 5,767 5,767 0
tailordb-object 12,136 12,136 0
tailordb-enum 2,462 2,462 0
resolver-basic 9,424 9,424 0
resolver-nested 26,111 26,111 0
resolver-array 18,187 18,187 0
executor-schedule 4,234 4,234 0
executor-webhook 873 873 0
executor-record 8,166 8,166 0
executor-resolver 4,369 4,369 0
executor-operation-function 869 869 0
executor-operation-gql 869 869 0
executor-operation-webhook 888 888 0
executor-operation-workflow 1,714 1,714 0

Reported by octocov

@toiroakr toiroakr marked this pull request as ready for review May 21, 2026 00:09
@toiroakr toiroakr requested a review from remiposo as a code owner May 21, 2026 00:09
@claude
Copy link
Copy Markdown

claude Bot commented May 21, 2026

📖 Docs Consistency Check

✅ No inconsistencies found between documentation and implementation.

Checked areas:

  • docs/testing.md - No references to __tests__ directory structure or removed vitest config patterns
  • docs/architecture.md - No references to internal test file organization
  • docs/getting-started.md - No references to specific test paths
  • CLAUDE.md - No references to __tests__ or src/vitest/__tests__/ paths
  • packages/sdk/docs/testing.md - Generic testing patterns; not affected by internal test relocation
  • example/ - No references to SDK internal test structure

Analysis:
This PR is a pure internal refactor that moves test files from src/vitest/__tests__/ to be colocated next to their source files in src/vitest/. The changes are purely organizational and do not affect:

  • Public APIs
  • User-facing testing patterns
  • Configuration schemas
  • CLI commands
  • Example code patterns

All documentation remains accurate as it focuses on user-facing testing patterns rather than SDK internal test organization.


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