mirror of
https://github.com/github/codeql-action.git
synced 2026-01-01 12:10:20 +08:00
Move initializeFeatures() to testing-utils
This change eliminates the need for setup-codeql.test to import from feature-flags.test, which makes the former run all tests defined in the latter.
This commit is contained in:
@@ -14,6 +14,7 @@ import * as defaults from "./defaults.json";
|
||||
import {
|
||||
CodeQLDefaultVersionInfo,
|
||||
Feature,
|
||||
featureConfig,
|
||||
FeatureEnablement,
|
||||
} from "./feature-flags";
|
||||
import { Logger } from "./logging";
|
||||
@@ -263,6 +264,13 @@ export function createFeatures(enabledFeatures: Feature[]): FeatureEnablement {
|
||||
};
|
||||
}
|
||||
|
||||
export function initializeFeatures(initialValue: boolean) {
|
||||
return Object.keys(featureConfig).reduce((features, key) => {
|
||||
features[key] = initialValue;
|
||||
return features;
|
||||
}, {});
|
||||
}
|
||||
|
||||
/**
|
||||
* Mocks the API for downloading the bundle tagged `tagName`.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user