diff --git a/backend/src/server/routes/v1/bdd-nock-router.ts b/backend/src/server/routes/v1/bdd-nock-router.ts index 91e74919c..e8e0b06a1 100644 --- a/backend/src/server/routes/v1/bdd-nock-router.ts +++ b/backend/src/server/routes/v1/bdd-nock-router.ts @@ -34,7 +34,9 @@ export const registerBddNockRouter = async (server: FastifyZodProvider) => { logger.info(definitions, "Defining nock"); nock.define(definitions as Definition[]); // Ensure we are activating the nocks, because we could have called `nock.restore()` before this call. - nock.activate(); + if (!nock.isActive()) { + nock.activate(); + } return { status: "ok" }; } });