test: opt version -r changelog test into repository storage (#12984)

The "bare version -r applies the release plan and cleans up the intent" test
asserts the committed-CHANGELOG flow: it reads lib/CHANGELOG.md and expects the
consumed intent to be deleted at version time. Since composing changelogs at
publish time (registry storage) became the default, `pnpm version -r` no longer
commits CHANGELOG.md — it parks the section under .changeset/changelogs/ and
defers intent GC until the registry confirms publication. With no verifyPublished
registry in the test, the changelog file is never written (ENOENT) and the
intent is never collected, so the test failed.

Opt the test into `versioning.changelog.storage: repository` so it keeps
exercising the committed-changelog + intent-cleanup path, matching the pattern
the versioning package's lifecycle tests already use. Registry-storage behavior
(parked section, deferred GC) is covered by those lifecycle tests.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Zoltan Kochan
2026-07-13 21:04:01 +02:00
committed by GitHub
parent a72c2b1953
commit 45f682fe46

View File

@@ -69,7 +69,12 @@ describe('change command and intent-consuming version -r', () => {
it('bare version -r applies the release plan and cleans up the intent', async () => {
const lib = addPkg({ name: 'lib', version: '1.0.0' })
const cli = addPkg({ name: 'cli', version: '2.0.0', dependencies: { lib: 'workspace:*' } })
const opts = baseOpts([lib, cli])
// Assert the committed-CHANGELOG flow: `repository` storage writes
// CHANGELOG.md and deletes the consumed intent at version time. The default
// `registry` storage instead parks the section and defers intent GC until
// the registry confirms publication — covered in the versioning package's
// lifecycle tests.
const opts = { ...baseOpts([lib, cli]), versioning: { changelog: { storage: 'repository' } } }
await change.handler({ ...opts, bump: 'major', summary: 'Breaking change.' } as any, ['lib']) // eslint-disable-line @typescript-eslint/no-explicit-any