Files
claude-engineering-plugin/tests/release-config.test.ts
Trevin Chow ab44d89b0b
Some checks failed
CI / pr-title (push) Has been cancelled
CI / test (push) Has been cancelled
Release PR / release-pr (push) Has been cancelled
Release PR / publish-cli (push) Has been cancelled
fix(release): remove stale release-as pin (#674)
2026-04-24 07:23:02 -07:00

59 lines
1.6 KiB
TypeScript

import { describe, expect, test } from "bun:test"
import { validateReleasePleaseConfig } from "../src/release/config"
describe("release-please config validation", () => {
test("rejects upward-relative changelog paths", () => {
const errors = validateReleasePleaseConfig({
packages: {
".": {
"changelog-path": "CHANGELOG.md",
},
"plugins/compound-engineering": {
"changelog-path": "../../CHANGELOG.md",
},
},
})
expect(errors).toHaveLength(1)
expect(errors[0]).toContain('Package "plugins/compound-engineering"')
expect(errors[0]).toContain("../../CHANGELOG.md")
})
test("allows package-local changelog paths and skipped changelogs", () => {
const errors = validateReleasePleaseConfig({
packages: {
".": {
"changelog-path": "CHANGELOG.md",
},
"plugins/compound-engineering": {
"skip-changelog": true,
},
".claude-plugin": {
"changelog-path": "CHANGELOG.md",
},
},
})
expect(errors).toEqual([])
})
test("rejects checked-in release-as pins", () => {
const errors = validateReleasePleaseConfig({
packages: {
".": {
"release-as": "3.0.2",
},
"plugins/compound-engineering": {
"release-as": "3.0.2",
},
},
})
expect(errors).toHaveLength(2)
expect(errors[0]).toContain('Package "."')
expect(errors[0]).toContain("release-as")
expect(errors[1]).toContain('Package "plugins/compound-engineering"')
expect(errors[1]).toContain("3.0.2")
})
})