diff --git a/libs/routers/src/IRouter.ts b/libs/routers/src/IRouter.ts index 877db8e..e498501 100644 --- a/libs/routers/src/IRouter.ts +++ b/libs/routers/src/IRouter.ts @@ -1,9 +1,9 @@ import type { File, StringRecord, RequestBodyData } from '@cordis/rest'; export type IRouter = { - get(options?: { query?: Q }): T; - delete(options?: { data?: D; reason?: string }): T; - patch(options: { data: D; reason?: string }): T; - put(options: { data: D; reason?: string }): T; - post(options: { data: D; reason?: string; files?: File[] }): T; + get(options?: { query?: Q }): Promise; + delete(options?: { data?: D; reason?: string }): Promise; + patch(options: { data: D; reason?: string }): Promise; + put(options: { data: D; reason?: string }): Promise; + post(options: { data: D; reason?: string; files?: File[] }): Promise; } & { [key: string]: IRouter }; diff --git a/libs/routers/src/restRouter.test.ts b/libs/routers/src/restRouter.test.ts index 5e63bc8..2ce6285 100644 --- a/libs/routers/src/restRouter.test.ts +++ b/libs/routers/src/restRouter.test.ts @@ -16,8 +16,8 @@ afterEach(() => { mockedMake.mockClear(); }); -test('basic routing', () => { - router.users['123'].get(); +test('basic routing', async () => { + await router.users['123'].get(); expect(mockedMake).toHaveBeenCalledTimes(1); expect(mockedMake).toHaveBeenCalledWith({ method: 'get', path: '/users/123' });