Move makeVersionOutput to testing-utils.js
This commit is contained in:
parent
a402be8739
commit
e827ad5b71
18 changed files with 110 additions and 114 deletions
19
lib/testing-utils.js
generated
19
lib/testing-utils.js
generated
|
|
@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.mockBundleDownloadApi = exports.createFeatures = exports.mockCodeQLVersion = exports.mockLanguagesInRepo = exports.mockFeatureFlagApiEndpoint = exports.getRecordingLogger = exports.setupActionsVars = exports.setupTests = exports.SAMPLE_DEFAULT_CLI_VERSION = exports.SAMPLE_DOTCOM_API_DETAILS = void 0;
|
||||
exports.mockBundleDownloadApi = exports.createFeatures = exports.mockCodeQLVersion = exports.makeVersionOutput = exports.mockLanguagesInRepo = exports.mockFeatureFlagApiEndpoint = exports.getRecordingLogger = exports.setupActionsVars = exports.setupTests = exports.SAMPLE_DEFAULT_CLI_VERSION = exports.SAMPLE_DOTCOM_API_DETAILS = void 0;
|
||||
const node_util_1 = require("node:util");
|
||||
const path_1 = __importDefault(require("path"));
|
||||
const github = __importStar(require("@actions/github"));
|
||||
|
|
@ -187,10 +187,25 @@ function mockLanguagesInRepo(languages) {
|
|||
return listLanguages;
|
||||
}
|
||||
exports.mockLanguagesInRepo = mockLanguagesInRepo;
|
||||
/**
|
||||
* Constructs a `VersionOutput` object for testing purposes only.
|
||||
*/
|
||||
const makeVersionOutput = (version) => ({
|
||||
productName: "CodeQL",
|
||||
vendor: "GitHub",
|
||||
sha: "",
|
||||
branches: [],
|
||||
copyright: "",
|
||||
unpackedLocation: "",
|
||||
configFileLocation: "",
|
||||
configFileFound: false,
|
||||
version,
|
||||
});
|
||||
exports.makeVersionOutput = makeVersionOutput;
|
||||
function mockCodeQLVersion(version) {
|
||||
return {
|
||||
async getVersion() {
|
||||
return CodeQL.makeVersionOutput(version);
|
||||
return (0, exports.makeVersionOutput)(version);
|
||||
},
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue