Fix nock import

This commit is contained in:
Fang-Pen Lin
2025-11-20 08:57:13 -08:00
parent f23884ab12
commit 5623c666b8
@@ -16,10 +16,9 @@ if (process.env.NODE_ENV !== "development") {
export const registerBddNockRouter = async (server: FastifyZodProvider) => { export const registerBddNockRouter = async (server: FastifyZodProvider) => {
const appCfg = getConfig(); const appCfg = getConfig();
const importNock = () => { const importNock = async () => {
// Notice: it seems like importing nock somehow increase memory usage a lots, let's import it lazily. const { default: nock } = await import("nock");
// eslint-disable-next-line import/no-extraneous-dependencies return nock;
return import("nock");
}; };
const checkIfBddNockApiEnabled = () => { const checkIfBddNockApiEnabled = () => {