Rename Language enum and use generic Language where possible

This commit is contained in:
Henry Mercer
2025-05-30 16:47:02 +01:00
parent e303175b83
commit 932be8feda
48 changed files with 246 additions and 239 deletions

8
lib/codeql.test.js generated
View File

@@ -65,7 +65,7 @@ const NO_FEATURES = (0, testing_utils_1.createFeatures)([]);
ava_1.default.beforeEach(() => {
(0, util_1.initializeEnvironment)("1.2.3");
stubConfig = (0, testing_utils_1.createTestConfig)({
languages: [languages_1.Language.cpp],
languages: [languages_1.KnownLanguage.cpp],
});
});
async function installIntoToolcache({ apiDetails = testing_utils_1.SAMPLE_DOTCOM_API_DETAILS, cliVersion, isPinned, tagName, tmpDir, }) {
@@ -101,7 +101,7 @@ async function stubCodeql() {
sinon.stub(codeqlObject, "getVersion").resolves((0, testing_utils_1.makeVersionInfo)("2.17.6"));
sinon
.stub(codeqlObject, "isTracedLanguage")
.withArgs(languages_1.Language.cpp)
.withArgs(languages_1.KnownLanguage.cpp)
.resolves(true);
return codeqlObject;
}
@@ -578,7 +578,7 @@ for (const { codeqlVersion, flagPassed, githubVersion, negativeFlagPassed, } of
sinon.stub(codeqlObject, "resolveExtractor").resolves("/path/to/extractor");
// io throws because of the test CodeQL object.
sinon.stub(io, "which").resolves("");
await t.throwsAsync(async () => await codeqlObject.runAutobuild(stubConfig, languages_1.Language.java), {
await t.throwsAsync(async () => await codeqlObject.runAutobuild(stubConfig, languages_1.KnownLanguage.java), {
instanceOf: util.ConfigurationError,
message: "We were unable to automatically build your code. Please provide manual build steps. " +
`See ${doc_url_1.DocUrl.AUTOMATIC_BUILD_FAILED} for more information. ` +
@@ -595,7 +595,7 @@ for (const { codeqlVersion, flagPassed, githubVersion, negativeFlagPassed, } of
sinon.stub(codeqlObject, "resolveExtractor").resolves("/path/to/extractor");
// io throws because of the test CodeQL object.
sinon.stub(io, "which").resolves("");
await t.throwsAsync(async () => await codeqlObject.runAutobuild(stubConfig, languages_1.Language.java), {
await t.throwsAsync(async () => await codeqlObject.runAutobuild(stubConfig, languages_1.KnownLanguage.java), {
instanceOf: util.ConfigurationError,
message: "We were unable to automatically build your code. Please provide manual build steps. " +
`See ${doc_url_1.DocUrl.AUTOMATIC_BUILD_FAILED} for more information. ` +