Skip to content

Commit

Permalink
fixed compatibility issues
Browse files Browse the repository at this point in the history
  • Loading branch information
YulNaumenko committed Apr 17, 2020
1 parent 62bc699 commit e7f894f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions x-pack/plugins/event_log/server/es/context.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { elasticsearchServiceMock, loggingServiceMock } from '../../../../../src
jest.mock('../lib/../../../../package.json', () => ({
version: '1.2.3',
}));
type EsClusterClient = Pick<jest.Mocked<ClusterClient>, 'callAsInternalUser' | 'asScoped'>;
export type EsClusterClient = Pick<ClusterClient, 'callAsInternalUser' | 'asScoped'>;

let logger: Logger;
let clusterClient: EsClusterClient;
Expand All @@ -24,7 +24,7 @@ describe('createEsContext', () => {
test('should return is ready state as falsy if not initialized', () => {
const context = createEsContext({
logger,
clusterClientPromise: Promise.resolve(clusterClient),
clusterClient,
indexNameRoot: 'test0',
});

Expand All @@ -37,7 +37,7 @@ describe('createEsContext', () => {
test('should return esNames', () => {
const context = createEsContext({
logger,
clusterClientPromise: Promise.resolve(clusterClient),
clusterClient,
indexNameRoot: 'test-index',
});

Expand All @@ -56,7 +56,7 @@ describe('createEsContext', () => {
test('should return exist false for esAdapter ilm policy, index template and alias before initialize', async () => {
const context = createEsContext({
logger,
clusterClientPromise: Promise.resolve(clusterClient),
clusterClient,
indexNameRoot: 'test1',
});
clusterClient.callAsInternalUser.mockResolvedValue(false);
Expand All @@ -73,7 +73,7 @@ describe('createEsContext', () => {
test('should return exist true for esAdapter ilm policy, index template and alias after initialize', async () => {
const context = createEsContext({
logger,
clusterClientPromise: Promise.resolve(clusterClient),
clusterClient,
indexNameRoot: 'test2',
});
clusterClient.callAsInternalUser.mockResolvedValue(true);
Expand Down

0 comments on commit e7f894f

Please sign in to comment.