Skip to content

Commit

Permalink
corrected typing in alerting test
Browse files Browse the repository at this point in the history
  • Loading branch information
gmmorris committed Apr 23, 2020
1 parent 5565c98 commit 2e22429
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions x-pack/legacy/plugins/task_manager/server/legacy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ export function createLegacyApi(legacyTaskManager: Promise<TaskManager>): Legacy
fetch: (opts: SearchOpts) => legacyTaskManager.then((tm: TaskManager) => tm.fetch(opts)),
get: (id: string) => legacyTaskManager.then((tm: TaskManager) => tm.get(id)),
remove: (id: string) => legacyTaskManager.then((tm: TaskManager) => tm.remove(id)),
schedule: (taskInstance: TaskInstanceWithDeprecatedFields, options?: unknown) =>
schedule: (taskInstance: TaskInstanceWithDeprecatedFields, options?: object) =>
legacyTaskManager.then((tm: TaskManager) => tm.schedule(taskInstance, options)),
runNow: (taskId: string) => legacyTaskManager.then((tm: TaskManager) => tm.runNow(taskId)),
ensureScheduled: (taskInstance: TaskInstanceWithId, options?: unknown) =>
ensureScheduled: (taskInstance: TaskInstanceWithId, options?: object) =>
legacyTaskManager.then((tm: TaskManager) => tm.ensureScheduled(taskInstance, options)),
};
}
14 changes: 7 additions & 7 deletions x-pack/plugins/alerting/server/plugin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { licensingMock } from '../../../plugins/licensing/server/mocks';
import { encryptedSavedObjectsMock } from '../../../plugins/encrypted_saved_objects/server/mocks';
import { taskManagerMock } from '../../task_manager/server/mocks';
import { eventLogServiceMock } from '../../event_log/server/event_log_service.mock';
import { KibanaRequest } from 'kibana/server';
import { KibanaRequest, CoreSetup } from 'kibana/server';

describe('Alerting Plugin', () => {
describe('setup()', () => {
Expand All @@ -21,13 +21,13 @@ describe('Alerting Plugin', () => {
const coreSetup = coreMock.createSetup();
const encryptedSavedObjectsSetup = encryptedSavedObjectsMock.createSetup();
await plugin.setup(
{
({
...coreSetup,
http: {
...coreSetup.http,
route: jest.fn(),
},
} as ReturnType<typeof coreMock.createSetup>,
} as unknown) as CoreSetup<AlertingPluginsStart, unknown>,
({
licensing: licensingMock.createSetup(),
encryptedSavedObjects: encryptedSavedObjectsSetup,
Expand Down Expand Up @@ -59,13 +59,13 @@ describe('Alerting Plugin', () => {
const coreSetup = coreMock.createSetup();
const encryptedSavedObjectsSetup = encryptedSavedObjectsMock.createSetup();
await plugin.setup(
{
({
...coreSetup,
http: {
...coreSetup.http,
route: jest.fn(),
},
} as ReturnType<typeof coreMock.createSetup>,
} as unknown) as CoreSetup<AlertingPluginsStart, unknown>,
({
licensing: licensingMock.createSetup(),
encryptedSavedObjects: encryptedSavedObjectsSetup,
Expand Down Expand Up @@ -102,13 +102,13 @@ describe('Alerting Plugin', () => {
usingEphemeralEncryptionKey: false,
};
await plugin.setup(
{
({
...coreSetup,
http: {
...coreSetup.http,
route: jest.fn(),
},
} as ReturnType<typeof coreMock.createSetup>,
} as unknown) as CoreSetup<AlertingPluginsStart, unknown>,
({
licensing: licensingMock.createSetup(),
encryptedSavedObjects: encryptedSavedObjectsSetup,
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/task_manager/server/task_runner.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import sinon from 'sinon';
import { minutesFromNow } from './lib/intervals';
import { asOk, asErr } from './lib/result_type';
import { TaskEvent, asTaskRunEvent, asTaskMarkRunningEvent } from './task_events';
import { ConcreteTaskInstance, TaskStatus } from './task';
import { ConcreteTaskInstance, TaskStatus, TaskDictionary, TaskDefinition } from './task';
import { TaskManagerRunner } from './task_runner';
import { mockLogger } from './test_utils';
import { SavedObjectsErrorHelpers } from '../../../../src/core/server';
Expand Down

0 comments on commit 2e22429

Please sign in to comment.