Rename getResults to readQueryResults

This commit is contained in:
Koen Vlaswinkel
2023-04-11 11:10:45 +02:00
parent 0b1b03d5b0
commit 9f3baadee9
3 changed files with 7 additions and 7 deletions

View File

@@ -27,7 +27,7 @@ import { ResolvableLocationValue } from "../pure/bqrs-cli-types";
import { showResolvableLocation } from "../interface-utils";
import { decodeBqrsToExternalApiUsages } from "./bqrs";
import { redactableError } from "../pure/errors";
import { getResults, runQuery } from "./external-api-usage-query";
import { readQueryResults, runQuery } from "./external-api-usage-query";
import { createDataExtensionYaml, loadDataExtensionYaml } from "./yaml";
import { ExternalApiUsage } from "./external-api-usage";
import { ModeledMethod } from "./modeled-method";
@@ -192,7 +192,7 @@ export class DataExtensionsEditorView extends AbstractWebview<
maxStep: 1500,
});
const bqrsChunk = await getResults({
const bqrsChunk = await readQueryResults({
cliServer: this.cliServer,
bqrsPath: queryResult.outputDir.bqrsPath,
logger: extLogger,

View File

@@ -90,7 +90,7 @@ export type GetResultsOptions = {
logger: Logger;
};
export async function getResults({
export async function readQueryResults({
cliServer,
bqrsPath,
logger,

View File

@@ -1,5 +1,5 @@
import {
getResults,
readQueryResults,
runQuery,
} from "../../../../src/data-extensions-editor/external-api-usage-query";
import { createMockLogger } from "../../../__mocks__/loggerMock";
@@ -135,7 +135,7 @@ describe("getResults", () => {
"result-sets": [],
});
expect(await getResults(options)).toBeUndefined();
expect(await readQueryResults(options)).toBeUndefined();
expect(options.logger.log).toHaveBeenCalledWith(
expect.stringMatching(/Expected exactly one result set/),
);
@@ -165,7 +165,7 @@ describe("getResults", () => {
],
});
expect(await getResults(options)).toBeUndefined();
expect(await readQueryResults(options)).toBeUndefined();
expect(options.logger.log).toHaveBeenCalledWith(
expect.stringMatching(/Expected exactly one result set/),
);
@@ -211,7 +211,7 @@ describe("getResults", () => {
};
options.cliServer.bqrsDecode.mockResolvedValue(decodedResultSet);
const result = await getResults(options);
const result = await readQueryResults(options);
expect(result).toEqual(decodedResultSet);
expect(options.cliServer.bqrsInfo).toHaveBeenCalledWith(options.bqrsPath);
expect(options.cliServer.bqrsDecode).toHaveBeenCalledWith(