More renaming

Avoid usage of "Feature Flag" unless we are talking specifically about
the response from github features api. Otherwise, use terms like
"Toggleable features".

Note both "toggleable" and "togglable" appear to be valid spellings of
the word. I chose the first for no good reason.
This commit is contained in:
Andrew Eisenberg 2022-10-07 11:33:32 -07:00
parent b27aed78f5
commit 1a17c59fb0
39 changed files with 237 additions and 200 deletions

View file

@ -4,6 +4,7 @@ import * as sinon from "sinon";
import * as apiClient from "./api-client";
import * as CodeQL from "./codeql";
import { Feature, FeatureEnablement } from "./feature-flags";
import { Logger } from "./logging";
import { HTTPError } from "./util";
@ -168,3 +169,18 @@ export function mockCodeQLVersion(version) {
},
} as CodeQL.CodeQL;
}
/**
* Create a feature enablement instance with the specified set of enabled features.
*
* This should be only used within tests.
*/
export function createFeatureFlags(
enabledFeatures: Feature[]
): FeatureEnablement {
return {
getValue: async (feature) => {
return enabledFeatures.includes(feature);
},
};
}