Skip to content

Commit

Permalink
reverts type change in mocks
Browse files Browse the repository at this point in the history
  • Loading branch information
TinaHeiligers committed Jul 9, 2022
1 parent 1c695c6 commit e17a1d8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import type { Logger } from '@kbn/logging';
import type { CoreContext } from '@kbn/core-base-server-internal';
import type { KibanaPrebootServicePreboot } from '@kbn/core-preboot-server';
import type { InternalPrebootServicePreboot } from './types';

/** @internal */
export class PrebootService {
Expand All @@ -21,7 +21,7 @@ export class PrebootService {
this.log = this.core.logger.get('preboot');
}

public preboot(): KibanaPrebootServicePreboot {
public preboot(): InternalPrebootServicePreboot {
return {
isSetupOnHold: () => this.isSetupOnHold,
holdSetupUntilResolved: (pluginName, reason, promise) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ export { prebootServiceMock } from './preboot_service.mock';
export type {
InternalPrebootServicePrebootMock,
PrebootServicePrebootMock,
PrebootServiceContract,
} from './preboot_service.mock';
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@
* Side Public License, v 1.
*/

import type { InternalPrebootServicePreboot } from '@kbn/core-preboot-server-internal';
import type { PrebootServicePreboot, KibanaPrebootServiceContract } from '@kbn/core-preboot-server';
import type {
InternalPrebootServicePreboot,
PrebootService,
} from '@kbn/core-preboot-server-internal';
import type { PrebootServicePreboot } from '@kbn/core-preboot-server';
import { PublicMethodsOf } from '@kbn/utility-types';

export type InternalPrebootServicePrebootMock = jest.Mocked<InternalPrebootServicePreboot>;
export type PrebootServicePrebootMock = jest.Mocked<PrebootServicePreboot>;
export type PrebootServiceContract = jest.Mocked<KibanaPrebootServiceContract>;

const createInternalPrebootContractMock = () => {
const mock: InternalPrebootServicePrebootMock = {
isSetupOnHold: jest.fn(),
Expand All @@ -30,6 +34,8 @@ const createPrebootContractMock = () => {
return mock;
};

type PrebootServiceContract = PublicMethodsOf<PrebootService>;

const createPrebootServiceMock = () => {
const mocked: jest.Mocked<PrebootServiceContract> = {
preboot: jest.fn(),
Expand Down
1 change: 1 addition & 0 deletions packages/core/preboot/core-preboot-server/src/contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export interface PrebootServicePreboot {
}

/**
* public version of InternalPrebootServicePreboot that is exposed in the public service contract
* @public
*/
export interface KibanaPrebootServicePreboot
Expand Down

0 comments on commit e17a1d8

Please sign in to comment.