Skip to content

Commit

Permalink
add unit test for new lib
Browse files Browse the repository at this point in the history
  • Loading branch information
tsullivan committed Jan 14, 2020
1 parent cb40fa3 commit 15ab24b
Showing 1 changed file with 42 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

import { Legacy } from 'kibana';
import { makeRequestFacade } from './make_request_facade';

test('makeRequestFacade', () => {
const originalRequest = ({
getBasePath: () => 'basebase',
params: {
param1: 123,
},
payload: {
payload1: 123,
},
headers: {
user: 123,
},
} as unknown) as Legacy.Request;

expect(makeRequestFacade(originalRequest)).toMatchInlineSnapshot(`
Object {
"getBasePath": [Function],
"getSavedObjectsClient": undefined,
"headers": Object {
"user": 123,
},
"params": Object {
"param1": 123,
},
"payload": Object {
"payload1": 123,
},
"pre": undefined,
"query": undefined,
"route": undefined,
}
`);
});

0 comments on commit 15ab24b

Please sign in to comment.