Skip to content

Commit 7f2b6ab

Browse files
authored
chore: format TS (#5)
Not sure how it wasn't formatted before
1 parent 067db78 commit 7f2b6ab

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

resources/mock-server/src/index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,23 @@ Polly.register(FetchAdapter);
88

99
export function getPolly(
1010
name: string,
11-
config: { mode: "record-new" | "record-overwrite" | "replay" },
11+
config: { mode: "record-new" | "record-overwrite" | "replay" }
1212
) {
1313
const pollyConfig: PollyConfig = {
1414
adapters: ["fetch"],
1515
persister: "fs",
1616
persisterOptions: {
1717
fs: {
18-
recordingsDir: path.resolve(__dirname, "../recordings"),
19-
},
18+
recordingsDir: path.resolve(__dirname, "../recordings")
19+
}
2020
},
2121
matchRequestsBy: {
2222
method: true,
2323
url: true, // includes query params
2424
headers: true,
2525
body: true,
26-
order: false,
27-
},
26+
order: false
27+
}
2828
};
2929

3030
if (config.mode === "record-new") {
@@ -46,7 +46,7 @@ export function getPolly(
4646
const problematicHeaders = ["content-encoding", "content-length", "vary"];
4747
polly.server.any().on("beforeReplay", (_req, rec) => {
4848
rec.response.headers = rec.response.headers.filter(
49-
(h: any) => !problematicHeaders.includes(h.name.toLowerCase()),
49+
(h: any) => !problematicHeaders.includes(h.name.toLowerCase())
5050
);
5151
});
5252

resources/mock-server/src/server.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ export async function startServer(): Promise<ServerInstance> {
2121
target: "pino-pretty",
2222
options: {
2323
translateTime: "HH:MM:ss Z",
24-
ignore: "pid,hostname",
25-
},
24+
ignore: "pid,hostname"
25+
}
2626
}
27-
: undefined,
28-
},
27+
: undefined
28+
}
2929
});
3030

3131
// Catch-all proxy through PollyJS
@@ -34,7 +34,7 @@ export async function startServer(): Promise<ServerInstance> {
3434
const url = new URL(request.url, "http://localhost:4001");
3535

3636
fastify.log.debug(
37-
`[Fastify] Incoming request: ${request.method} ${request.url}`,
37+
`[Fastify] Incoming request: ${request.method} ${request.url}`
3838
);
3939
fastify.log.debug(`[Fastify] Transformed to: ${request.method} ${url}`);
4040

@@ -48,7 +48,7 @@ export async function startServer(): Promise<ServerInstance> {
4848
}
4949

5050
fastify.log.debug(
51-
`[Fastify] Forwarded headers: ${JSON.stringify(request.headers)}`,
51+
`[Fastify] Forwarded headers: ${JSON.stringify(request.headers)}`
5252
);
5353

5454
const response = await fetch(url, {
@@ -57,7 +57,7 @@ export async function startServer(): Promise<ServerInstance> {
5757
body:
5858
request.method !== "GET" && request.method !== "HEAD"
5959
? JSON.stringify(request.body)
60-
: undefined,
60+
: undefined
6161
});
6262

6363
const data = await response.text();
@@ -83,7 +83,7 @@ export async function startServer(): Promise<ServerInstance> {
8383
// Start listening without awaiting (non-blocking)
8484
const listenPromise = fastify.listen({
8585
port,
86-
host: "0.0.0.0",
86+
host: "0.0.0.0"
8787
});
8888

8989
await fastify.ready();
@@ -94,6 +94,6 @@ export async function startServer(): Promise<ServerInstance> {
9494
close: async () => {
9595
await fastify.close();
9696
},
97-
listen: listenPromise,
97+
listen: listenPromise
9898
};
9999
}

0 commit comments

Comments
 (0)