test(uni-path): migrate from jest to vitest - #250
Merged
Conversation
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
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migrates
packages/uni-pathoff jest, following the pattern its already-migrated siblingpackages/path-equalset inbuild: modernize the toolchain.What changed
packages/uni-path/vitest.config.ts, copied from the sibling's:include: ['ts/**/*.spec.ts'], v8 coverage overts/**/*.tsexcluding specs,text+lcovreporters.jest.config.mjsremoved.expect/itfromvitestinstead of@jest/globals. Nothing else in them changed.test,test:watch,devandcoveragescripts now run vitest.jest,ts-jest,@repobuddy/jest,@jest/globals,jest-watch-suspend,jest-watch-typeahead, andjest-watch-toggle-config-2— this was its last consumer in the repo. Addedvitestand@vitest/coverage-v8, both at^4.1.11to match the sibling.Coverage thresholds
None are set, deliberately. The
@repobuddy/jestts-esm-watchpreset carried nocoverageThreshold, so jest enforced nothing here; adding the sibling's 100% gate would be a new failing requirement, not an equivalent one (ts/constants.tshas 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-pathis"private": trueat version0.0.0, andpackages/path-equalis untouched.For the owner to decide
packages/uni-pathis excluded from the workspace ('!packages/uni-path'inpnpm-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 runningpnpm test/pnpm coverage, then revertingpnpm-workspace.yamlandpnpm-lock.yamlso the status quo is preserved.While doing that I found a pre-existing breakage unrelated to this PR:
pnpm buildinuni-pathfails withTS6306/TS6310, because itstsconfig.jsonstill declares a project reference to../path-equal, which moved tonoEmit: truewith nocompositewhen it switched to tsdown. Worth deciding whetheruni-pathshould be revived (re-included in the workspace, reference fixed) or deleted.🤖 Generated with Claude Code
https://claude.ai/code/session_01Soh3yt33myhRT23UcW4Roh