Skip to content

Commit 518cee2

Browse files
committed
Fix test for error
1 parent 0caae76 commit 518cee2

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

x-pack/test/api_integration/apis/infra/metrics_alerting.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,19 +56,19 @@ export default function({ getService }: FtrProviderContext) {
5656
expect(result.hits).to.be.ok();
5757
expect(result.aggregations).to.be.ok();
5858
});
59-
it('should not work with a filterQuery in KQL format', async () => {
59+
it('should not work with a filterQuery in KQL format', () => {
6060
const searchBody = getElasticsearchMetricQuery(
6161
getSearchParams('avg'),
6262
undefined,
6363
'"agent.hostname":"foo"'
6464
);
65-
const result = await client.search({
66-
index,
67-
body: searchBody,
68-
});
69-
expect(result.error).to.be.ok();
70-
expect(result.hits).to.not.be.ok();
71-
expect(result.aggregations).to.not.be.ok();
65+
expect(
66+
async () =>
67+
await client.search({
68+
index,
69+
body: searchBody,
70+
})
71+
).to.throwError();
7272
});
7373
});
7474
describe('querying with a groupBy parameter', () => {

0 commit comments

Comments
 (0)