mirror of
https://github.com/PostHog/posthog.git
synced 2024-11-30 19:41:46 +01:00
7207da93e9
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Ben White <ben@posthog.com>
18 lines
890 B
TypeScript
18 lines
890 B
TypeScript
import * as s from '../../src/utils/db/sql'
|
|
|
|
// mock functions that get data from postgres and give them the right types
|
|
type UnPromisify<F> = F extends (...args: infer A) => Promise<infer T> ? (...args: A) => T : never
|
|
export const getPluginRows = s.getActivePluginRows as unknown as jest.MockedFunction<
|
|
UnPromisify<typeof s.getActivePluginRows>
|
|
>
|
|
export const getPluginAttachmentRows = s.getPluginAttachmentRows as unknown as jest.MockedFunction<
|
|
UnPromisify<typeof s.getPluginAttachmentRows>
|
|
>
|
|
export const getPluginConfigRows = s.getPluginConfigRows as unknown as jest.MockedFunction<
|
|
UnPromisify<typeof s.getPluginConfigRows>
|
|
>
|
|
export const setPluginCapabilities = s.setPluginCapabilities as unknown as jest.MockedFunction<
|
|
UnPromisify<typeof s.setPluginCapabilities>
|
|
>
|
|
export const disablePlugin = s.disablePlugin as unknown as jest.MockedFunction<UnPromisify<void>>
|