Merge branch 'aeisenberg/unrevert-query-filters' into aeisenberg/fix-config-files

This commit is contained in:
Andrew Eisenberg 2022-08-11 14:16:50 -07:00
commit fa2bc211fd
61 changed files with 882 additions and 112 deletions

View file

@ -208,6 +208,7 @@ test("getGitHubVersion", async (t) => {
const v = await util.getGitHubVersion({
auth: "",
url: "https://github.com",
apiURL: undefined,
});
t.deepEqual(util.GitHubVariant.DOTCOM, v.type);
@ -215,6 +216,7 @@ test("getGitHubVersion", async (t) => {
const v2 = await util.getGitHubVersion({
auth: "",
url: "https://ghe.example.com",
apiURL: undefined,
});
t.deepEqual(
{ type: util.GitHubVariant.GHES, version: "2.0" } as util.GitHubVersion,
@ -225,6 +227,7 @@ test("getGitHubVersion", async (t) => {
const ghae = await util.getGitHubVersion({
auth: "",
url: "https://example.githubenterprise.com",
apiURL: undefined,
});
t.deepEqual({ type: util.GitHubVariant.GHAE }, ghae);
@ -232,6 +235,7 @@ test("getGitHubVersion", async (t) => {
const v3 = await util.getGitHubVersion({
auth: "",
url: "https://ghe.example.com",
apiURL: undefined,
});
t.deepEqual({ type: util.GitHubVariant.DOTCOM }, v3);
});
@ -299,13 +303,13 @@ const ML_POWERED_JS_STATUS_TESTS: Array<[string[], string]> = [
// If no packs are loaded, status is false.
[[], "false"],
// If another pack is loaded but not the ML-powered query pack, status is false.
[["someOtherPack"], "false"],
[["some-other/pack"], "false"],
// If the ML-powered query pack is loaded with a specific version, status is that version.
[[`${util.ML_POWERED_JS_QUERIES_PACK_NAME}@~0.1.0`], "~0.1.0"],
// If the ML-powered query pack is loaded with a specific version and another pack is loaded, the
// status is the version of the ML-powered query pack.
[
["someOtherPack", `${util.ML_POWERED_JS_QUERIES_PACK_NAME}@~0.1.0`],
["some-other/pack", `${util.ML_POWERED_JS_QUERIES_PACK_NAME}@~0.1.0`],
"~0.1.0",
],
// If the ML-powered query pack is loaded without a version, the status is "latest".
@ -320,7 +324,7 @@ const ML_POWERED_JS_STATUS_TESTS: Array<[string[], string]> = [
],
// If the ML-powered query pack is loaded with no specific version, and another pack is loaded,
// the status is "latest".
[["someOtherPack", util.ML_POWERED_JS_QUERIES_PACK_NAME], "latest"],
[["some-other/pack", util.ML_POWERED_JS_QUERIES_PACK_NAME], "latest"],
];
for (const [packs, expectedStatus] of ML_POWERED_JS_STATUS_TESTS) {