Fix rebase

This commit is contained in:
Fang-Pen Lin
2025-11-20 08:57:04 -08:00
parent 8c3699b437
commit 889fb8b7e0
+25 -25
View File
@@ -26,31 +26,31 @@ export const registerBddNockRouter = async (server: FastifyZodProvider) => {
} }
}; };
// server.route({ server.route({
// method: "POST", method: "POST",
// url: "/define", url: "/define",
// schema: { schema: {
// body: z.object({ definitions: z.unknown().array() }), body: z.object({ definitions: z.unknown().array() }),
// response: { response: {
// 200: z.object({ status: z.string() }) 200: z.object({ status: z.string() })
// } }
// }, },
// onRequest: verifyAuth([AuthMode.JWT]), onRequest: verifyAuth([AuthMode.JWT]),
// handler: async (req) => { handler: async (req) => {
// checkIfBddNockApiEnabled(); checkIfBddNockApiEnabled();
// const { body } = req; const { body } = req;
// const { definitions } = body; const { definitions } = body;
// logger.info(definitions, "Defining nock"); logger.info(definitions, "Defining nock");
// const processedDefinitions = definitions.map((definition: unknown) => { const processedDefinitions = definitions.map((definition: unknown) => {
// const { path, ...rest } = definition as Definition; const { path, ...rest } = definition as Definition;
// return { return {
// ...rest, ...rest,
// path: path:
// path !== undefined && typeof path === "string" path !== undefined && typeof path === "string"
// ? path ? path
// : new RegExp((path as unknown as { regex: string }).regex ?? "") : new RegExp((path as unknown as { regex: string }).regex ?? "")
// } as Definition; } as Definition;
// }); });
const nock = await importNock(); const nock = await importNock();
nock.define(processedDefinitions); nock.define(processedDefinitions);