Skip to content

Commit

Permalink
Add missing http start mock contract, fix test in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
eliperelman committed May 7, 2019
1 parent 90a985f commit 54181b3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/public/http/http_service.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { HttpService, HttpSetup } from './http_service';
import { HttpService, HttpSetup, HttpStart } from './http_service';

const createSetupContractMock = (): jest.Mocked<HttpSetup> => ({
fetch: jest.fn(),
Expand All @@ -31,8 +31,10 @@ const createSetupContractMock = (): jest.Mocked<HttpSetup> => ({
addLoadingCount: jest.fn(),
getLoadingCount$: jest.fn(),
});
const createStartContractMock = (): jest.Mocked<HttpStart> => undefined;
const createMock = (): jest.Mocked<PublicMethodsOf<HttpService>> => ({
setup: jest.fn().mockReturnValue(createSetupContractMock()),
start: jest.fn().mockReturnValue(createStartContractMock()),
stop: jest.fn(),
});

Expand Down
1 change: 1 addition & 0 deletions src/core/public/http/http_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,4 @@ export class HttpService {

/** @public */
export type HttpSetup = ReturnType<HttpService['setup']>;
export type HttpStart = ReturnType<HttpService['start']>;
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ describe('Kuery value suggestions', function () {
method: 'POST',
body: '{"query":"","field":"machine.os.raw","boolFilter":[]}',
credentials: 'same-origin',
signal: {},
headers: {
'Content-Type': 'application/json',
'kbn-version': '1.2.3',
Expand Down

0 comments on commit 54181b3

Please sign in to comment.