Fix test to be immune to running on Actions
This commit is contained in:
parent
836cbe0784
commit
d99e994194
5 changed files with 7 additions and 3 deletions
2
lib/upload-lib.test.js
generated
2
lib/upload-lib.test.js
generated
|
|
@ -33,6 +33,7 @@ ava_1.default("validate correct payload used per version", async (t) => {
|
|||
{ type: "ghes", version: "3.0.0" },
|
||||
];
|
||||
const allVersions = newVersions.concat(oldVersions);
|
||||
process.env["GITHUB_EVENT_NAME"] = "push";
|
||||
for (const version of allVersions) {
|
||||
const payload = uploadLib.buildPayload("commit", "refs/heads/master", "key", undefined, "", undefined, "/opt/src", undefined, ["CodeQL", "eslint"], version, "actions");
|
||||
// Not triggered by a pull request
|
||||
|
|
@ -48,6 +49,7 @@ ava_1.default("validate correct payload used per version", async (t) => {
|
|||
}
|
||||
for (const version of oldVersions) {
|
||||
const payload = uploadLib.buildPayload("commit", "refs/pull/123/merge", "key", undefined, "", undefined, "/opt/src", undefined, ["CodeQL", "eslint"], version, "actions");
|
||||
// These older versions won't expect these values
|
||||
t.falsy(payload.base_ref);
|
||||
t.falsy(payload.base_sha);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue