diff --git a/test/command-feedback-format.test.ts b/test/command-feedback-format.test.ts new file mode 100644 index 0000000..c402903 --- /dev/null +++ b/test/command-feedback-format.test.ts @@ -0,0 +1,10 @@ +import assert from "node:assert/strict"; +import test from "node:test"; +import { formatPermissionDeniedMessage } from "../src/github/commandFeedback.js"; + +test("permission denied message names the commenter, command, and remedy", () => { + const message = formatPermissionDeniedMessage("alice", "/recheck"); + assert.match(message, /@alice/); + assert.match(message, /`\/recheck`/); + assert.match(message, /write.*maintain.*admin|maintainer/i); +});