Skip to content

Commit

Permalink
add test case when body is null
Browse files Browse the repository at this point in the history
  • Loading branch information
mshustov committed Sep 15, 2020
1 parent 98c4f40 commit 5a03e4d
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/core/server/elasticsearch/client/configure_client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,32 @@ describe('configureClient', () => {
]
`);
});

it('when request body is null', () => {
const client = configureClient(
createFakeConfig({
logQueries: true,
}),
{ logger, scoped: false }
);

const response = createResponseWithBody(null);

client.emit('response', null, response);
expect(loggingSystemMock.collect(logger).debug).toMatchInlineSnapshot(`
Array [
Array [
"200
GET /foo?hello=dolly",
Object {
"tags": Array [
"query",
],
},
],
]
`);
});
});

it('properly encode queries', () => {
Expand Down

0 comments on commit 5a03e4d

Please sign in to comment.