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:
Chuan-kai Lin
2025-07-11 09:25:54 -07:00
parent 90d7727554
commit b37e7e2c5d
3 changed files with 10 additions and 8 deletions

View File

@@ -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`.
*