Skip to content

Commit

Permalink
adds prom client to mercury client in test helper
Browse files Browse the repository at this point in the history
  • Loading branch information
aristidesstaffieri committed Jan 4, 2024
1 parent c8ecdb8 commit 77770bb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/helper/test-helper.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Client, fetchExchange } from "@urql/core";
import pino from "pino";
import { nativeToScVal } from "stellar-sdk";
import Prometheus from "prom-client";

import { mutation, query } from "../service/mercury/queries";
import { MercuryClient } from "../service/mercury";
Expand Down Expand Up @@ -254,12 +255,15 @@ jest.spyOn(client, "mutation").mockImplementation((_mutation: any): any => {
}
});

const register = new Prometheus.Registry();

const mockMercuryClient = new MercuryClient(
"http://example.com/graphql",
mercurySession,
client,
renewClient,
testLogger
testLogger,
register
);

jest
Expand All @@ -274,7 +278,7 @@ jest
}
);
async function getDevServer() {
const server = initApiServer(mockMercuryClient, testLogger);
const server = initApiServer(mockMercuryClient, testLogger, register);
await server.listen();
return server;
}
Expand Down

0 comments on commit 77770bb

Please sign in to comment.