Migrate test toolchain to vitest 4 - #144
Merged
Merged
Conversation
This was referenced Jun 17, 2026
Closed
Closed
Closed
scalvert
force-pushed
the
deps/vitest-4-migration
branch
from
June 18, 2026 02:11
a314349 to
e5eb7ff
Compare
rwjblue-glean
approved these changes
Jun 18, 2026
Bump vitest from ^0.34.6 to ^4.1.9, which pulls in vite 8. esbuild is no longer part of the dependency tree (vite 8 uses rolldown), so the previous transitive esbuild dependency is dropped entirely. The npm scripts used the `--no-threads` flag to avoid running tests in worker threads, which is required because the suite calls `process.chdir()` into temp dirs (unsupported in worker threads, throws ERR_WORKER_UNSUPPORTED_OPERATION). That flag was removed in modern vitest, so configure the equivalent in vitest.config.ts via `pool: 'forks'` + `maxWorkers: 1` and drop the dead flags from the scripts. Update two inline snapshots whose only change is vitest 4 no longer double-escaping inner quotes in the snapshot literal (data is identical). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This plugin fully replaces release-it's built-in `npm` plugin, but if the
built-in plugin is left enabled release-it also runs `npm version` and tries
to publish the root package, producing confusing errors. Detect this in the
constructor and emit a clear warning telling users to set `npm: false`
(`npm: { publish: false }` is not sufficient). Also document the correct
configuration and the TypeScript `Config` type gotcha in the README.
Closes #125
Closes #132
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The warning was emitted from the constructor and the test read it via `log.warn.mock.calls`. release-it 19's test factory pre-wraps the logger as a spy so `.mock` exists, but release-it 17/18 do not, so the tests threw `Cannot read properties of undefined (reading 'calls')` on those versions. Move the check to the top of `init()` (before the `skipChecks` guard) so it still fires on every release but after the test harness can install a log capture. The harness now overrides `log.warn` into a plain `warnings` array (version-independent), and the three tests drive `init()` with `skipChecks`. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
scalvert
force-pushed
the
deps/vitest-4-migration
branch
from
June 18, 2026 16:18
baeaa26 to
7a6a92c
Compare
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 the dev/test toolchain to the current major versions and makes the suite pass under them.
Changes
vitest^0.34.6→^4.1.9(pulls invite8).--no-threadsCLI flag withpool: 'forks'+maxWorkers: 1invitest.config.ts. The testsprocess.chdir()into temp dirs, which is unsupported in worker threads, so a single forked child process is required.defineConfignow imported fromvitest/config(idiomatic for v4; makestesta typed property).Supersedes #126 and #139
Both were dependabot bumps that failed all CI. #126 bumped a transitive
esbuild; under vite 8's rolldown-based toolchainesbuildis no longer in the dependency tree at all, so that bump is moot.npm testis green: lint + 40/40 tests.🤖 Generated with Claude Code