Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | 22x 1x 1x 1x 1x 1x 78x 78x 78x 1x | import { request, testRoute } from "@cooper/backend/src/tests/utils"; import { generateMock } from "@anatine/zod-mock"; import { Auth$UserSchema } from "@cooper/ts-rest/src/types"; import { seed } from "@cooper/backend/src/tests/mocking"; import { contract } from "@cooper/ts-rest/src/contract"; export const mochaHooks = { // Runs before every test in every file beforeEach: async function () { await request().get("/testing/reset").expect(200); // Create a new initial user for use in tests on protected routes // Simplifies other tests by removing need to do this step const mockUser = generateMock(Auth$UserSchema, { seed }); await testRoute(request(), contract.public.auth.signup).send(mockUser).expect(200); }, }; |