export function makeFetchMockConnectedTo(fastify) {
    return async (url, conf) => {
        const response = await fastify.inject({
            method: conf === null || conf === void 0 ? void 0 : conf.method,
            headers: conf === null || conf === void 0 ? void 0 : conf.headers,
            payload: conf === null || conf === void 0 ? void 0 : conf.body,
            path: new URL(url).pathname,
        });
        return {
            status: response.statusCode,
            statusText: response.statusMessage,
            text: async () => response.payload,
            json: async () => response.json(),
        };
    };
}
//# sourceMappingURL=fetch-mock.js.map