Skip to content

test(uni-path): migrate from jest to vitest - #250

Merged
unional merged 1 commit into
mainfrom
test/uni-path-vitest
Sep 7, 2026
Merged

test(uni-path): migrate from jest to vitest#250
unional merged 1 commit into
mainfrom
test/uni-path-vitest

Conversation

@unional

@unional unional commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

Migrates packages/uni-path off jest, following the pattern its already-migrated sibling packages/path-equal set in build: modernize the toolchain.

What changed

  • New hand-written packages/uni-path/vitest.config.ts, copied from the sibling's: include: ['ts/**/*.spec.ts'], v8 coverage over ts/**/*.ts excluding specs, text + lcov reporters.
  • jest.config.mjs removed.
  • Both spec files import expect/it from vitest instead of @jest/globals. Nothing else in them changed.
  • test, test:watch, dev and coverage scripts now run vitest.
  • devDependencies removed: jest, ts-jest, @repobuddy/jest, @jest/globals, jest-watch-suspend, jest-watch-typeahead, and jest-watch-toggle-config-2 — this was its last consumer in the repo. Added vitest and @vitest/coverage-v8, both at ^4.1.11 to match the sibling.

Coverage thresholds

None are set, deliberately. The @repobuddy/jest ts-esm-watch preset carried no coverageThreshold, so jest enforced nothing here; adding the sibling's 100% gate would be a new failing requirement, not an equivalent one (ts/constants.ts has no tests). The gate is exactly where it was.

Tests

2 test files, 2 tests before; 2 test files, 2 tests after. Both pass under vitest.

Published artifact

Unchanged, and no changeset is included: uni-path is "private": true at version 0.0.0, and packages/path-equal is untouched.

For the owner to decide

packages/uni-path is excluded from the workspace ('!packages/uni-path' in pnpm-workspace.yaml, since 2023), so CI never installs, builds or tests it — this change is verified locally only. I verified it by temporarily un-excluding the package, installing, and running pnpm test / pnpm coverage, then reverting pnpm-workspace.yaml and pnpm-lock.yaml so the status quo is preserved.

While doing that I found a pre-existing breakage unrelated to this PR: pnpm build in uni-path fails with TS6306/TS6310, because its tsconfig.json still declares a project reference to ../path-equal, which moved to noEmit: true with no composite when it switched to tsdown. Worth deciding whether uni-path should be revived (re-included in the workspace, reference fixed) or deleted.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Soh3yt33myhRT23UcW4Roh

Mirror the already-migrated sibling `packages/path-equal`: a hand-written
`vitest.config.ts` over `ts/**/*.spec.ts`, v8 coverage, and specs importing
`expect`/`it` from `vitest` instead of `@jest/globals`.

Drops the last consumer of the retired `jest-watch-toggle-config-2` fork, plus
`jest`, `ts-jest`, `@repobuddy/jest`, `jest-watch-suspend`,
`jest-watch-typeahead` and `@jest/globals`.

No coverage thresholds are added: the `@repobuddy/jest` `ts-esm-watch` preset
set none, so this keeps the gate exactly where jest had it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Soh3yt33myhRT23UcW4Roh
@changeset-bot

changeset-bot Bot commented Sep 7, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 51ea9bc

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

@unional
unional added this pull request to the merge queue Sep 7, 2026
Merged via the queue into main with commit e038120 Sep 7, 2026
5 checks passed
@unional
unional deleted the test/uni-path-vitest branch September 7, 2026 20:08
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