Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions bin/check-changelog.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,15 @@ describe("needsChangelog", () => {
).toBe(false);
});

it("ignores a test file's snapshots", () => {
expect(
needsChangelog(
["packages/bugc/src/evmgen/__snapshots__/pairing.test.ts.snap"],
["packages/bugc"],
),
).toBe(false);
});

it("ignores an examples test suite", () => {
expect(
needsChangelog(
Expand Down
6 changes: 3 additions & 3 deletions bin/check-changelog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
return changedPaths.some((path) => path.startsWith("schemas/"));
}

// colocated test files carry no consumer-visible change, and this also
// covers the *.examples.test.ts suites
const testFile = /\.test\.tsx?$/;
// colocated test files and their snapshots carry no consumer-visible
// change, and this also covers the *.examples.test.ts suites
const testFile = /\.test\.tsx?(\.snap)?$/;

function touchesPackage(changedPaths: string[], prefix: string): boolean {
return changedPaths.some(
Expand Down Expand Up @@ -188,7 +188,7 @@
const base = argv[0] ?? defaultBase;
const root = fileURLToPath(new URL("..", import.meta.url));
if (!resolvesToCommit(root, base)) {
console.error(

Check warning on line 191 in bin/check-changelog.ts

View workflow job for this annotation

GitHub Actions / lint-and-format

Unexpected console statement
`check-changelog: cannot resolve the base ref "${base}"; fetch it` +
" first, or name one that exists.",
);
Expand All @@ -207,10 +207,10 @@
formatProblemsMessage(problems),
].filter((message) => message.length > 0);
if (messages.length > 0) {
console.error(messages.join("\n\n"));

Check warning on line 210 in bin/check-changelog.ts

View workflow job for this annotation

GitHub Actions / lint-and-format

Unexpected console statement
return 1;
}
console.log("changelog: ok");

Check warning on line 213 in bin/check-changelog.ts

View workflow job for this annotation

GitHub Actions / lint-and-format

Unexpected console statement
return 0;
}

Expand Down
Loading
Loading