Skip to content

Commit

Permalink
Showing 3 changed files with 31 additions and 4 deletions.
9 changes: 9 additions & 0 deletions lib/actions-util.test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/actions-util.test.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 21 additions & 3 deletions src/actions-util.test.ts
@@ -217,19 +217,18 @@ test("validateWorkflow() when on.pull_request for wildcard branches", (t) => {
const errors = actionsutil.validateWorkflow({
on: {
push: { branches: ["feature/*"] },
pull_request: {branches: "feature/moose"},
pull_request: { branches: "feature/moose" },
},
});

t.deepEqual(errors, []);
});


test("validateWorkflow() when on.pull_request for mismatched wildcard branches", (t) => {
const errors = actionsutil.validateWorkflow({
on: {
push: { branches: ["feature/moose"] },
pull_request: {branches: "feature/*"},
pull_request: { branches: "feature/*" },
},
});

@@ -273,4 +272,23 @@ test("formatWorkflowCause()", (t) => {
test("patternsOverlap()", (t) => {
t.false(actionsutil.patternsOverlap("main-*", "main"));
t.true(actionsutil.patternsOverlap("*", "*"));
t.true(actionsutil.patternsOverlap("*", "main-*"));
t.false(actionsutil.patternsOverlap("main-*", "*"));
t.false(actionsutil.patternsOverlap("main-*", "main"));
t.true(actionsutil.patternsOverlap("main", "main"));
t.false(actionsutil.patternsOverlap("*", "feature/*"));
t.true(actionsutil.patternsOverlap("**", "feature/*"));
t.false(actionsutil.patternsOverlap("feature-*", "**"));
t.true(
actionsutil.patternsOverlap(
"/robin/*/release/*",
"/robin/moose/release/goose"
)
);
t.false(
actionsutil.patternsOverlap(
"/robin/moose/release/goose",
"/robin/*/release/*"
)
);
});

0 comments on commit 145a3c1

Please sign in to comment.