mirror of
https://github.com/grafana/grafana.git
synced 2025-01-06 06:03:38 -06:00
d1e52d4788
* type fixes * couple more * just a couple more * small fixes to prometheus typings * improve some more datasource types
13 lines
537 B
TypeScript
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);
|
|
};
|