Add more wildcard examples
This commit is contained in:
parent
14719432ef
commit
145a3c1ed9
3 changed files with 31 additions and 4 deletions
9
lib/actions-util.test.js
generated
9
lib/actions-util.test.js
generated
|
|
@ -216,5 +216,14 @@ ava_1.default("formatWorkflowCause()", (t) => {
|
||||||
ava_1.default("patternsOverlap()", (t) => {
|
ava_1.default("patternsOverlap()", (t) => {
|
||||||
t.false(actionsutil.patternsOverlap("main-*", "main"));
|
t.false(actionsutil.patternsOverlap("main-*", "main"));
|
||||||
t.true(actionsutil.patternsOverlap("*", "*"));
|
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/*"));
|
||||||
});
|
});
|
||||||
//# sourceMappingURL=actions-util.test.js.map
|
//# sourceMappingURL=actions-util.test.js.map
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -217,19 +217,18 @@ test("validateWorkflow() when on.pull_request for wildcard branches", (t) => {
|
||||||
const errors = actionsutil.validateWorkflow({
|
const errors = actionsutil.validateWorkflow({
|
||||||
on: {
|
on: {
|
||||||
push: { branches: ["feature/*"] },
|
push: { branches: ["feature/*"] },
|
||||||
pull_request: {branches: "feature/moose"},
|
pull_request: { branches: "feature/moose" },
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
t.deepEqual(errors, []);
|
t.deepEqual(errors, []);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
test("validateWorkflow() when on.pull_request for mismatched wildcard branches", (t) => {
|
test("validateWorkflow() when on.pull_request for mismatched wildcard branches", (t) => {
|
||||||
const errors = actionsutil.validateWorkflow({
|
const errors = actionsutil.validateWorkflow({
|
||||||
on: {
|
on: {
|
||||||
push: { branches: ["feature/moose"] },
|
push: { branches: ["feature/moose"] },
|
||||||
pull_request: {branches: "feature/*"},
|
pull_request: { branches: "feature/*" },
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -273,4 +272,23 @@ test("formatWorkflowCause()", (t) => {
|
||||||
test("patternsOverlap()", (t) => {
|
test("patternsOverlap()", (t) => {
|
||||||
t.false(actionsutil.patternsOverlap("main-*", "main"));
|
t.false(actionsutil.patternsOverlap("main-*", "main"));
|
||||||
t.true(actionsutil.patternsOverlap("*", "*"));
|
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/*"
|
||||||
|
)
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue