Skip to content

test(types): migrate selector checks to Vitest 5 - #1422

Open
christopher-buss wants to merge 4 commits into
roblox-ts:masterfrom
christopher-buss:test/vitest-type-tests
Open

christopher-buss wants to merge 4 commits into
roblox-ts:masterfrom
christopher-buss:test/vitest-type-tests

Conversation

@christopher-buss

@christopher-buss christopher-buss commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Type-level selector coverage depended on a bespoke Compiler API runner and custom //=> annotations. This replaces it with pinned Vitest 5 typecheck tests while preserving inference, exact diagnostic, fallback, and work-limit contracts.

Changes

  • Configure Vitest 5.0.1 to run *.spec-d.ts files through tsc only.
  • Express all 115 selector contracts with native expectTypeOf assertions and call-site rejection checks.
  • Assert exact Selector.ValidateSelector diagnostics for every rejected selector.
  • Remove the custom src/runTests.ts harness and its annotation format.

Evidence

A tracer assertion deliberately expected Model[] from QueryDescendants("Part"); Vitest discovered the type suite and rejected it because the public API returns Part[]. After correcting that tracer and completing the migration, Vitest discovers both files and all 115 preserved contracts.

Testing

  • npm test
  • npm run build
  • npm run eslint
  • Expanded declaration check over all eight include/**/*.d.ts files
  • git diff --check master...HEAD

On Windows, the existing npm run check script passes its glob literally to tsc; the equivalent expanded declaration check passes.

Generated with Codex.

christopher-buss and others added 3 commits October 3, 2026 15:07
Replace the compiler-API harness with Vitest 5 type tests for selector inference, validation,
diagnostics, and work limits.

Co-authored-by: Codex <noreply@openai.com>
Inline one-use type subjects so assertions contain setup and names describe selector behavior.
Limit the test program to the public declaration graph.

Co-authored-by: Codex <noreply@openai.com>
Pair rejected calls with exact validation message assertions and name rejection behavior directly.
Remove narrative section comments from selector type tests.

Co-authored-by: Codex <noreply@openai.com>
@christopher-buss
christopher-buss marked this pull request as ready for review October 3, 2026 15:29

This branch has not been deployed

No deployments
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