1
0
Fork 0
mirror of synced 2024-09-19 02:39:37 +12:00
budibase/packages/backend-core/tests/core/utilities/structures/koa.ts

17 lines
360 B
TypeScript
Raw Normal View History

2022-11-17 02:06:30 +13:00
import { createMockContext, createMockCookies } from "@shopify/jest-koa-mocks"
import { BBContext } from "@budibase/types"
2022-05-04 09:58:19 +12:00
export const newContext = (): BBContext => {
const ctx = createMockContext()
return {
...ctx,
path: "/",
2022-11-17 02:06:30 +13:00
cookies: createMockCookies(),
request: {
...ctx.request,
headers: {},
body: {},
},
}
2022-05-04 09:58:19 +12:00
}