Convert GitHub variant to an enum.

This commit is contained in:
Chris Gavin 2021-02-15 09:29:10 +00:00
parent 0656b2c1ad
commit c9ca4ec1bd
No known key found for this signature in database
GPG key ID: 07F950B80C27E4DA
24 changed files with 67 additions and 52 deletions

View file

@ -6,7 +6,7 @@ import test from "ava";
import { getRunnerLogger } from "./logging";
import { setupTests } from "./testing-utils";
import * as uploadLib from "./upload-lib";
import { GitHubVersion, withTmpDir } from "./util";
import { GitHubVersion, GitHubVariant, withTmpDir } from "./util";
setupTests(test);
@ -26,12 +26,12 @@ test("validateSarifFileSchema - invalid", (t) => {
test("validate correct payload used per version", async (t) => {
const newVersions: GitHubVersion[] = [
{ type: "dotcom" },
{ type: "ghes", version: "3.1.0" },
{ type: GitHubVariant.DOTCOM },
{ type: GitHubVariant.GHES, version: "3.1.0" },
];
const oldVersions: GitHubVersion[] = [
{ type: "ghes", version: "2.22.1" },
{ type: "ghes", version: "3.0.0" },
{ type: GitHubVariant.GHES, version: "2.22.1" },
{ type: GitHubVariant.GHES, version: "3.0.0" },
];
const allVersions = newVersions.concat(oldVersions);