Send short codes that do not need URL encoding for better splunk tracing
This commit is contained in:
parent
6df1fc5e38
commit
2ac22e8935
10 changed files with 215 additions and 72 deletions
30
lib/actions-util.test.js
generated
30
lib/actions-util.test.js
generated
|
|
@ -146,6 +146,15 @@ ava_1.default("validateWorkflow() when on.push is mismatched for pull_request",
|
|||
});
|
||||
t.deepEqual(errors, [actionsutil.ErrMismatchedBranches]);
|
||||
});
|
||||
ava_1.default("validateWorkflow() when on.pull_request for every branch but push specifies branches", (t) => {
|
||||
const errors = actionsutil.validateWorkflow({
|
||||
on: {
|
||||
push: { branches: ["main"] },
|
||||
pull_request: null,
|
||||
},
|
||||
});
|
||||
t.deepEqual(errors, [actionsutil.ErrMismatchedBranches]);
|
||||
});
|
||||
ava_1.default("validateWorkflow() when HEAD^2 is checked out", (t) => {
|
||||
const errors = actionsutil.validateWorkflow({
|
||||
on: ["push", "pull_request"],
|
||||
|
|
@ -153,4 +162,25 @@ ava_1.default("validateWorkflow() when HEAD^2 is checked out", (t) => {
|
|||
});
|
||||
t.deepEqual(errors, [actionsutil.ErrCheckoutWrongHead]);
|
||||
});
|
||||
ava_1.default("formatWorkflowErrors() when there is one error", (t) => {
|
||||
const message = actionsutil.formatWorkflowErrors([
|
||||
actionsutil.ErrCheckoutWrongHead,
|
||||
]);
|
||||
t.true(message.startsWith("1 issue was detected with this workflow:"));
|
||||
});
|
||||
ava_1.default("formatWorkflowErrors() when there are multiple errors", (t) => {
|
||||
const message = actionsutil.formatWorkflowErrors([
|
||||
actionsutil.ErrCheckoutWrongHead,
|
||||
actionsutil.ErrPathsSpecified,
|
||||
]);
|
||||
t.true(message.startsWith("2 issues were detected with this workflow:"));
|
||||
});
|
||||
ava_1.default("formatWorkflowCause()", (t) => {
|
||||
const message = actionsutil.formatWorkflowCause([
|
||||
actionsutil.ErrCheckoutWrongHead,
|
||||
actionsutil.ErrPathsSpecified,
|
||||
]);
|
||||
t.deepEqual(message, "CheckoutWrongHead,PathsSpecified");
|
||||
t.deepEqual(actionsutil.formatWorkflowCause(undefined), undefined);
|
||||
});
|
||||
//# sourceMappingURL=actions-util.test.js.map
|
||||
Loading…
Add table
Add a link
Reference in a new issue