mirror of
https://github.com/github/codeql-action.git
synced 2026-01-01 04:00:24 +08:00
Remove tests that require us to have at least one feature with a toolsVersion
If no features have a `toolsVersion` property, we'll never hit those code paths, so it isn't that important to test them. Having a synthetic feature is an option but might create user confusion.
This commit is contained in:
@@ -285,30 +285,6 @@ for (const feature of Object.keys(featureConfig)) {
|
||||
}
|
||||
}
|
||||
|
||||
// If we ever run into a situation where we no longer have any features that
|
||||
// specify a minimum version or required tools feature, then we will have a
|
||||
// bunch of code no longer being tested. This is unlikely, and this test will
|
||||
// fail if that happens.
|
||||
// If we do end up in that situation, then we should consider adding a synthetic
|
||||
// feature with a minimum version that is only used for tests.
|
||||
test("At least one feature has a minimum version specified", (t) => {
|
||||
t.assert(
|
||||
Object.values(featureConfig).some((f) => f.minimumVersion !== undefined),
|
||||
"At least one feature should have a minimum version specified",
|
||||
);
|
||||
|
||||
t.assert(
|
||||
Object.values(featureConfig).some((f) => f.toolsFeature !== undefined),
|
||||
"At least one feature should have a required tools feature specified",
|
||||
);
|
||||
|
||||
// An even less likely scenario is that we no longer have any features.
|
||||
t.assert(
|
||||
Object.values(featureConfig).length > 0,
|
||||
"There should be at least one feature",
|
||||
);
|
||||
});
|
||||
|
||||
test("Feature flags are saved to disk", async (t) => {
|
||||
await withTmpDir(async (tmpDir) => {
|
||||
const features = setUpFeatureFlagTests(tmpDir);
|
||||
|
||||
Reference in New Issue
Block a user