mirror of
https://github.com/github/codeql-action.git
synced 2025-12-24 00:00:20 +08:00
Refactoring: Introduce common method to stub a config
This means that we don't need to update irrelevant test cases when we add a new configuration property.
This commit is contained in:
@@ -8,19 +8,18 @@ import * as actionsUtil from "./actions-util";
|
||||
import { GitHubApiDetails } from "./api-client";
|
||||
import * as apiClient from "./api-client";
|
||||
import { setCodeQL } from "./codeql";
|
||||
import { Config, defaultAugmentationProperties } from "./config-utils";
|
||||
import { Config } from "./config-utils";
|
||||
import { uploadDatabases } from "./database-upload";
|
||||
import { Language } from "./languages";
|
||||
import { RepositoryNwo } from "./repository";
|
||||
import {
|
||||
createTestConfig,
|
||||
getRecordingLogger,
|
||||
LoggedMessage,
|
||||
setupActionsVars,
|
||||
setupTests,
|
||||
} from "./testing-utils";
|
||||
import {
|
||||
DEFAULT_DEBUG_ARTIFACT_NAME,
|
||||
DEFAULT_DEBUG_DATABASE_NAME,
|
||||
GitHubVariant,
|
||||
HTTPError,
|
||||
initializeEnvironment,
|
||||
@@ -41,20 +40,10 @@ const testApiDetails: GitHubApiDetails = {
|
||||
};
|
||||
|
||||
function getTestConfig(tmpDir: string): Config {
|
||||
return {
|
||||
return createTestConfig({
|
||||
languages: [Language.javascript],
|
||||
originalUserInput: {},
|
||||
tempDir: tmpDir,
|
||||
codeQLCmd: "foo",
|
||||
gitHubVersion: { type: GitHubVariant.DOTCOM },
|
||||
dbLocation: tmpDir,
|
||||
debugMode: false,
|
||||
debugArtifactName: DEFAULT_DEBUG_ARTIFACT_NAME,
|
||||
debugDatabaseName: DEFAULT_DEBUG_DATABASE_NAME,
|
||||
augmentationProperties: defaultAugmentationProperties,
|
||||
trapCaches: {},
|
||||
trapCacheDownloadTime: 0,
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
async function mockHttpRequests(databaseUploadStatusCode: number) {
|
||||
|
||||
Reference in New Issue
Block a user