Skip to content

test(devtools-ui): split type assertions into '*.test-d' files and enable vitest 'typecheck' - #611

Merged
sukvvon merged 1 commit into
mainfrom
chore/devtools-ui-type-tests
Dec 5, 2026
Merged

sukvvon merged 1 commit into
mainfrom
chore/devtools-ui-type-tests

Conversation

@sukvvon

@sukvvon sukvvon commented Dec 5, 2026 •

Copy link
Copy Markdown
Member

🎯 Changes

  • Rename tests/deep-keys.ts to tests/deep-keys.test-d.ts, since it only contains type assertions for CollapsiblePaths.
  • Move the type assertions out of runtime test files into *.test-d.ts files:
    • retains literal structural token types from semantic-theme.test.ts to semantic-theme.test-d.ts
    • keeps CopiedCopier theme required from index.test.ts to index.test-d.ts, wrapped in describe('CopiedCopier')
  • Rename tests/tree.tsx to tests/tree.test.tsx so it matches the test file pattern.
  • In packages/devtools-ui/vite.config.ts:
    • Narrow include to tests/**/*.test.{ts,tsx} and remove the exclude for tests/test-setup.ts.
    • Enable typecheck, so vitest runs the *.test-d.ts files as type tests.
  • Remove the packages/devtools-ui entry override from knip.json, since knip now detects the test files through the vitest plugin.

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested code changes locally with pnpm test:pr, or these tests do not apply to this pull request.
  • I fully understand the code in this pull request, including any code generated with AI assistance.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

Summary by CodeRabbit

  • Tests

    • Added type-level checks for copier theme requirements and semantic theme token types.
    • Updated test coverage organization while retaining runtime checks for theme behavior, styling, rendering, and icons.
    • Enabled type checking in the test suite.
  • Chores

    • Adjusted test discovery settings for the development tools workspace.

@sukvvon sukvvon self-assigned this Dec 5, 2026
@changeset-bot

changeset-bot Bot commented Dec 5, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: b5bb4ce

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@coderabbitai

coderabbitai Bot commented Dec 5, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Vitest now runs type checking with dedicated type-test files. Type assertions for CopiedCopier and semantic theme tokens move out of runtime tests. The Vitest test-file pattern is narrowed, and the devtools-ui test entry is removed from Knip configuration.

Changes: Devtools UI type tests

Layer / File(s) Summary
Configure type-test discovery
knip.json, packages/devtools-ui/vite.config.ts
Vitest now includes only .test.ts and .test.tsx files and enables type checking. The packages/devtools-ui test entry is removed from Knip configuration.
Separate type assertions from runtime tests
packages/devtools-ui/tests/index.test-d.ts, packages/devtools-ui/tests/index.test.ts, packages/devtools-ui/tests/semantic-theme.test-d.ts, packages/devtools-ui/tests/semantic-theme.test.ts
Dedicated type-test files assert the CopiedCopier theme requirement and semantic theme token types. The corresponding type assertions and imports are removed from runtime tests.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Suggested reviewers: alemtuzlak, harry-whorlow

Merge Risk: Minimal · up to b5bb4

This change only affects test and type-check configuration in devtools-ui and does not touch published code. No concrete merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the test-type split into '*.test-d' files and the enabling of Vitest typecheck. The changeset covers both: type assertions move to *.test-d.ts files, and vite.config.ts enables typeche…
Description check Passed The description follows the template. It has a Changes section that lists each file change and its motivation, including the renames, the moved type assertions, the vite.config.ts edits, and the knip.…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the test-type split into '*.test-d' files and the enabling of Vitest typecheck. The changeset covers both: type assertions move to *.test-d.ts files, and vite.config.ts enables typecheck. The title does not mention the test file renames, the include narrowing, or the knip.json change, but these are secondary details. The title uses a conventional 'test(scope):' prefix and is 92 characters, which is long but still readable.

Full details: Description check

Explanation

The description follows the template. It has a Changes section that lists each file change and its motivation, including the renames, the moved type assertions, the vite.config.ts edits, and the knip.json change. The Checklist items are marked. The Release Impact section marks the docs/CI/dev-only option. The description is complete and specific.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between bd94643 and b5bb4ce.

Files selected for processing: 8

  • knip.json
  • packages/devtools-ui/tests/deep-keys.test-d.ts
  • packages/devtools-ui/tests/index.test-d.ts
  • packages/devtools-ui/tests/index.test.ts
  • packages/devtools-ui/tests/semantic-theme.test-d.ts
  • packages/devtools-ui/tests/semantic-theme.test.ts
  • packages/devtools-ui/tests/tree.test.tsx
  • packages/devtools-ui/vite.config.ts
Files with no reviewable changes: 1

  • knip.json

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 0 remain after this review.

@nx-cloud

nx-cloud Bot commented Dec 5, 2026 •

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit b5bb4ce

Command Status Duration Result
nx affected --targets=test:oxlint,test:sherif,t... ✅ Succeeded 3m 25s View ↗
nx run-many --target=test:e2e --parallel=1 --pr... ✅ Succeeded 1m 21s View ↗
nx run-many --targets=build --exclude=examples/... ✅ Succeeded 26s View ↗

💡 With Ultracache enabled, Nx Cloud learns each task's file inputs in CI and uses them on later runs. Turn on Ultracache in workspace settings ↗ · Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-12-05 02:07:51 UTC

@pkg-pr-new

pkg-pr-new Bot commented Dec 5, 2026

Copy link
Copy Markdown
More templates

@tanstack/angular-devtools

npm i https://pkg.pr.new/@tanstack/angular-devtools@611

@tanstack/devtools

npm i https://pkg.pr.new/@tanstack/devtools@611

@tanstack/devtools-a11y

npm i https://pkg.pr.new/@tanstack/devtools-a11y@611

@tanstack/devtools-bundler-core

npm i https://pkg.pr.new/@tanstack/devtools-bundler-core@611

@tanstack/devtools-client

npm i https://pkg.pr.new/@tanstack/devtools-client@611

@tanstack/devtools-rspack

npm i https://pkg.pr.new/@tanstack/devtools-rspack@611

@tanstack/devtools-ui

npm i https://pkg.pr.new/@tanstack/devtools-ui@611

@tanstack/devtools-utils

npm i https://pkg.pr.new/@tanstack/devtools-utils@611

@tanstack/devtools-vite

npm i https://pkg.pr.new/@tanstack/devtools-vite@611

@tanstack/devtools-webmcp

npm i https://pkg.pr.new/@tanstack/devtools-webmcp@611

@tanstack/devtools-event-bus

npm i https://pkg.pr.new/@tanstack/devtools-event-bus@611

@tanstack/devtools-event-client

npm i https://pkg.pr.new/@tanstack/devtools-event-client@611

@tanstack/preact-devtools

npm i https://pkg.pr.new/@tanstack/preact-devtools@611

@tanstack/react-devtools

npm i https://pkg.pr.new/@tanstack/react-devtools@611

@tanstack/solid-devtools

npm i https://pkg.pr.new/@tanstack/solid-devtools@611

@tanstack/svelte-devtools

npm i https://pkg.pr.new/@tanstack/svelte-devtools@611

@tanstack/vue-devtools

npm i https://pkg.pr.new/@tanstack/vue-devtools@611

commit: b5bb4ce

@sukvvon
sukvvon merged commit 39e7210 into main Dec 5, 2026
11 checks passed
@sukvvon
sukvvon deleted the chore/devtools-ui-type-tests branch December 5, 2026 03:13
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