2023-07-26 02:32:26 +12:00
|
|
|
import { db } from "../../../src"
|
|
|
|
|
2023-03-01 02:54:34 +13:00
|
|
|
export function expectFunctionWasCalledTimesWith(
|
|
|
|
jestFunction: any,
|
|
|
|
times: number,
|
|
|
|
argument: any
|
|
|
|
) {
|
|
|
|
expect(
|
|
|
|
jestFunction.mock.calls.filter((call: any) => call[0] === argument).length
|
|
|
|
).toBe(times)
|
|
|
|
}
|
2023-07-26 02:32:26 +12:00
|
|
|
|
|
|
|
export const expectAnyInternalColsAttributes: {
|
|
|
|
[K in (typeof db.CONSTANT_INTERNAL_ROW_COLS)[number]]: any
|
|
|
|
} = {
|
|
|
|
tableId: expect.anything(),
|
|
|
|
type: expect.anything(),
|
|
|
|
_id: expect.anything(),
|
|
|
|
_rev: expect.anything(),
|
|
|
|
createdAt: expect.anything(),
|
|
|
|
updatedAt: expect.anything(),
|
|
|
|
}
|
2023-07-26 03:14:38 +12:00
|
|
|
|
|
|
|
export const expectAnyExternalColsAttributes: {
|
|
|
|
[K in (typeof db.CONSTANT_EXTERNAL_ROW_COLS)[number]]: any
|
|
|
|
} = {
|
|
|
|
tableId: expect.anything(),
|
|
|
|
_id: expect.anything(),
|
|
|
|
_rev: expect.anything(),
|
|
|
|
}
|