Skip to content

Commit

Permalink
Add multi-regex test
Browse files Browse the repository at this point in the history
  • Loading branch information
mheap committed Feb 12, 2024
1 parent 8b18d52 commit 6cf0256
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,22 @@ describe("Required Labels", () => {
expect(core.setOutput).toBeCalledWith("labels", "enhancement");
});

it("exactly (multiple regex)", async () => {
restoreTest = mockPr({
INPUT_LABELS: "backport/none\nbackport \\d.\\d",
INPUT_MODE: "exactly",
INPUT_COUNT: "1",
INPUT_USE_REGEX: "true",
});
mockLabels(["backport 3.7"]);

await action();

expect(core.setOutput).toBeCalledTimes(2);
expect(core.setOutput).toBeCalledWith("status", "success");
expect(core.setOutput).toBeCalledWith("labels", "backport 3.7");
});

it("at least X (regex)", async () => {
restoreTest = mockPr({
INPUT_LABELS: "enhance.*\nbug\ntriage",
Expand Down

0 comments on commit 6cf0256

Please sign in to comment.