grafana/public/test/core/redux/mocks.ts
Ashley Harrison d1e52d4788
Chore: type fixes (#77618)
* type fixes

* couple more

* just a couple more

* small fixes to prometheus typings

* improve some more datasource types
2023-11-06 11:28:44 +00:00

13 lines
537 B
TypeScript

import { ActionCreatorWithoutPayload, PayloadActionCreator } from '@reduxjs/toolkit';
export const mockToolkitActionCreator = <P = void, T extends string = string>(creator: PayloadActionCreator<P, T>) => {
return Object.assign(jest.fn(), creator);
};
export type ToolkitActionCreatorWithoutPayloadMockType = typeof mockToolkitActionCreatorWithoutPayload &
ActionCreatorWithoutPayload;
export const mockToolkitActionCreatorWithoutPayload = (creator: ActionCreatorWithoutPayload) => {
return Object.assign(jest.fn(), creator);
};