Add more test cases
This commit is contained in:
parent
c8ee1f4ef3
commit
14719432ef
3 changed files with 42 additions and 1 deletions
18
lib/actions-util.test.js
generated
18
lib/actions-util.test.js
generated
|
|
@ -167,6 +167,24 @@ ava_1.default("validateWorkflow() when on.pull_request for every branch but push
|
||||||
});
|
});
|
||||||
t.deepEqual(errors, [actionsutil.WorkflowErrors.MismatchedBranches]);
|
t.deepEqual(errors, [actionsutil.WorkflowErrors.MismatchedBranches]);
|
||||||
});
|
});
|
||||||
|
ava_1.default("validateWorkflow() when on.pull_request for wildcard branches", (t) => {
|
||||||
|
const errors = actionsutil.validateWorkflow({
|
||||||
|
on: {
|
||||||
|
push: { branches: ["feature/*"] },
|
||||||
|
pull_request: { branches: "feature/moose" },
|
||||||
|
},
|
||||||
|
});
|
||||||
|
t.deepEqual(errors, []);
|
||||||
|
});
|
||||||
|
ava_1.default("validateWorkflow() when on.pull_request for mismatched wildcard branches", (t) => {
|
||||||
|
const errors = actionsutil.validateWorkflow({
|
||||||
|
on: {
|
||||||
|
push: { branches: ["feature/moose"] },
|
||||||
|
pull_request: { branches: "feature/*" },
|
||||||
|
},
|
||||||
|
});
|
||||||
|
t.deepEqual(errors, [actionsutil.WorkflowErrors.MismatchedBranches]);
|
||||||
|
});
|
||||||
ava_1.default("validateWorkflow() when HEAD^2 is checked out", (t) => {
|
ava_1.default("validateWorkflow() when HEAD^2 is checked out", (t) => {
|
||||||
const errors = actionsutil.validateWorkflow({
|
const errors = actionsutil.validateWorkflow({
|
||||||
on: ["push", "pull_request"],
|
on: ["push", "pull_request"],
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -213,6 +213,29 @@ test("validateWorkflow() when on.pull_request for every branch but push specifie
|
||||||
t.deepEqual(errors, [actionsutil.WorkflowErrors.MismatchedBranches]);
|
t.deepEqual(errors, [actionsutil.WorkflowErrors.MismatchedBranches]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("validateWorkflow() when on.pull_request for wildcard branches", (t) => {
|
||||||
|
const errors = actionsutil.validateWorkflow({
|
||||||
|
on: {
|
||||||
|
push: { branches: ["feature/*"] },
|
||||||
|
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/*"},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
t.deepEqual(errors, [actionsutil.WorkflowErrors.MismatchedBranches]);
|
||||||
|
});
|
||||||
|
|
||||||
test("validateWorkflow() when HEAD^2 is checked out", (t) => {
|
test("validateWorkflow() when HEAD^2 is checked out", (t) => {
|
||||||
const errors = actionsutil.validateWorkflow({
|
const errors = actionsutil.validateWorkflow({
|
||||||
on: ["push", "pull_request"],
|
on: ["push", "pull_request"],
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue