fix: assert no shipped changelog heading is deleted or duplicated #134
1 changed files with 7 additions and 2 deletions
|
|
@ -705,11 +705,16 @@ describe("changelog-monotonic.sh — release headings are append-only (#133)", (
|
||||||
/^ {6}- name: no shipped changelog heading/.test(l),
|
/^ {6}- name: no shipped changelog heading/.test(l),
|
||||||
);
|
);
|
||||||
const after = ciLines.slice(monoStart + 1);
|
const after = ciLines.slice(monoStart + 1);
|
||||||
const monoEnd = after.findIndex((l) => /^ {6}- /.test(l) || /^ {2}\S/.test(l));
|
const monoEnd = after.findIndex(
|
||||||
|
(l) => /^ {6}- /.test(l) || /^ {2}\S/.test(l),
|
||||||
|
);
|
||||||
const monoBlock =
|
const monoBlock =
|
||||||
monoStart < 0
|
monoStart < 0
|
||||||
? undefined
|
? undefined
|
||||||
: [ciLines[monoStart], ...after.slice(0, monoEnd < 0 ? after.length : monoEnd)].join("\n");
|
: [
|
||||||
|
ciLines[monoStart],
|
||||||
|
...after.slice(0, monoEnd < 0 ? after.length : monoEnd),
|
||||||
|
].join("\n");
|
||||||
expect(monoBlock).toBeDefined();
|
expect(monoBlock).toBeDefined();
|
||||||
expect(monoBlock).toContain("changelog-monotonic.sh");
|
expect(monoBlock).toContain("changelog-monotonic.sh");
|
||||||
// Anchored: an `if:` inside a `run:` line is not a step condition.
|
// Anchored: an `if:` inside a `run:` line is not a step condition.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue