Fix test to be immune to running on Actions

This commit is contained in:
Robin Neatherway 2020-11-30 18:35:55 +00:00
parent 836cbe0784
commit d99e994194
5 changed files with 7 additions and 3 deletions

View file

@ -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);
}