Skip to content

Commit

Permalink
More type fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
smith committed Oct 2, 2020
1 parent e07e1ac commit c2f01ce
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { ConnectionElement } from '../../../common/service_map';
import { groupResourceNodes } from './group_resource_nodes';
import preGroupedData from './mock_responses/group_resource_nodes_pregrouped.json';
import expectedGroupedData from './mock_responses/group_resource_nodes_grouped.json';
import preGroupedData from './mock_responses/group_resource_nodes_pregrouped.json';

describe('groupResourceNodes', () => {
it('should group external nodes', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"value": 10000,
"relation": "gte"
},
"max_score": null,
"max_score": 0,
"hits": []
},
"aggregations": {
Expand Down
28 changes: 23 additions & 5 deletions x-pack/plugins/apm/server/lib/services/annotations/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import { getDerivedServiceAnnotations } from './get_derived_service_annotations';
import {
SearchParamsMock,
ESSearchRequest,
ESSearchResponse,
} from '../../../../typings/elasticsearch';
import {
inspectSearchParams,
SearchParamsMock,
} from '../../../utils/test_helpers';
import { getDerivedServiceAnnotations } from './get_derived_service_annotations';
import multipleVersions from './__fixtures__/multiple_versions.json';
import noVersions from './__fixtures__/no_versions.json';
import oneVersion from './__fixtures__/one_version.json';
import multipleVersions from './__fixtures__/multiple_versions.json';
import versionsFirstSeen from './__fixtures__/versions_first_seen.json';

describe('getServiceAnnotations', () => {
Expand Down Expand Up @@ -50,7 +54,14 @@ describe('getServiceAnnotations', () => {
searchAggregatedTransactions: false,
}),
{
mockResponse: () => oneVersion,
mockResponse: () =>
oneVersion as ESSearchResponse<
unknown,
ESSearchRequest,
{
restTotalHitsAsInt: false;
}
>,
}
);

Expand All @@ -74,7 +85,14 @@ describe('getServiceAnnotations', () => {
searchAggregatedTransactions: false,
}),
{
mockResponse: () => responses.shift(),
mockResponse: () =>
(responses.shift() as unknown) as ESSearchResponse<
unknown,
ESSearchRequest,
{
restTotalHitsAsInt: false;
}
>,
}
);

Expand Down

0 comments on commit c2f01ce

Please sign in to comment.