Add some new tests and fix some comments

This commit is contained in:
Andrew Eisenberg 2022-11-23 16:16:02 -08:00
parent f79028af27
commit ad7ca9bf21
22 changed files with 339 additions and 68 deletions

6
lib/testing-utils.js generated
View file

@ -19,7 +19,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.createFeatures = exports.mockCodeQLVersion = exports.mockLangaugesInRepo = exports.mockFeatureFlagApiEndpoint = exports.getRecordingLogger = exports.setupActionsVars = exports.setupTests = void 0;
exports.createFeatures = exports.mockCodeQLVersion = exports.mockLanguagesInRepo = exports.mockFeatureFlagApiEndpoint = exports.getRecordingLogger = exports.setupActionsVars = exports.setupTests = void 0;
const github = __importStar(require("@actions/github"));
const sinon = __importStar(require("sinon"));
const apiClient = __importStar(require("./api-client"));
@ -144,7 +144,7 @@ function mockFeatureFlagApiEndpoint(responseStatusCode, response) {
sinon.stub(apiClient, "getApiClient").value(() => client);
}
exports.mockFeatureFlagApiEndpoint = mockFeatureFlagApiEndpoint;
function mockLangaugesInRepo(languages) {
function mockLanguagesInRepo(languages) {
const mockClient = sinon.stub(apiClient, "getApiClient");
const listLanguages = sinon.stub().resolves({
status: 200,
@ -162,7 +162,7 @@ function mockLangaugesInRepo(languages) {
});
return listLanguages;
}
exports.mockLangaugesInRepo = mockLangaugesInRepo;
exports.mockLanguagesInRepo = mockLanguagesInRepo;
function mockCodeQLVersion(version) {
return {
async getVersion() {