Skip to content

Commit

Permalink
cleans up nodes usage API call
Browse files Browse the repository at this point in the history
  • Loading branch information
TinaHeiligers committed Sep 24, 2020
1 parent a572d75 commit 06e3b79
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ describe('get_nodes_usage', () => {
const esClient = elasticsearchServiceMock.createClusterClient().asInternalUser;
esClient.nodes.usage.mockImplementationOnce(
// @ts-ignore
async (_params = { metric: '_all', timeout: TIMEOUT }) => {
async (_params = { timeout: TIMEOUT }) => {
return response;
}
);
const item = await getNodesUsage(esClient);
expect(esClient.nodes.usage).toHaveBeenCalledWith({ metric: '_all', timeout: TIMEOUT });
expect(esClient.nodes.usage).toHaveBeenCalledWith({ timeout: TIMEOUT });
expect(item).toStrictEqual({
nodes: [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ export async function fetchNodesUsage(
esClient: ElasticsearchClient
): Promise<NodesFeatureUsageResponse> {
const { body } = await esClient.nodes.usage<NodesFeatureUsageResponse>({
metric: '_all',
timeout: TIMEOUT,
});
return body;
Expand Down

0 comments on commit 06e3b79

Please sign in to comment.