Skip to content

Commit 83b06fc

Browse files
CCR 3
Fix prettier formatting on factory.ts, session.ts, and factory.test.ts (collapse multi-line signatures/expressions to Prettier print width).
1 parent 0c69054 commit 83b06fc

3 files changed

Lines changed: 8 additions & 22 deletions

File tree

nodejs/src/factory.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,7 @@ export interface SessionFactoryApi {
151151
name: string,
152152
options?: RunOptions & { background?: false }
153153
): Promise<TResult>;
154-
run<TResult = unknown>(
155-
name: string,
156-
options?: RunOptions
157-
): Promise<TResult | FactoryRunResult>;
154+
run<TResult = unknown>(name: string, options?: RunOptions): Promise<TResult | FactoryRunResult>;
158155
run<TArgs, TResult>(
159156
factory: FactoryHandle<TArgs, TResult>,
160157
options: RunOptions<TArgs> & { background: true }

nodejs/src/session.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,7 @@ async function awaitFactoryOperation<TResult>(
236236
throwIfFactoryAborted(signal);
237237
let rejectAbort: ((reason?: unknown) => void) | undefined;
238238
const onAbort = () =>
239-
rejectAbort?.(
240-
signal.reason ?? new DOMException("Factory run was aborted", "AbortError")
241-
);
239+
rejectAbort?.(signal.reason ?? new DOMException("Factory run was aborted", "AbortError"));
242240
try {
243241
return await Promise.race([
244242
operation,

nodejs/test/factory.test.ts

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -392,9 +392,7 @@ describe("factories", () => {
392392
expect(cachedProducerCalls).toBe(1);
393393
expect(failingProducerCalls).toBe(2);
394394
expect(
395-
sendRequest.mock.calls.filter(
396-
([method]) => method === "session.factory.journal.put"
397-
)
395+
sendRequest.mock.calls.filter(([method]) => method === "session.factory.journal.put")
398396
).toHaveLength(2);
399397
});
400398

@@ -730,10 +728,7 @@ describe("factories", () => {
730728
args: {},
731729
});
732730
await vi.waitFor(() =>
733-
expect(sendRequest).toHaveBeenCalledWith(
734-
"session.factory.agent",
735-
expect.anything()
736-
)
731+
expect(sendRequest).toHaveBeenCalledWith("session.factory.agent", expect.anything())
737732
);
738733

739734
await session.clientSessionApis.factory!.abort({
@@ -824,17 +819,13 @@ describe("factories", () => {
824819
);
825820
const session = new CopilotSession("session-run", { sendRequest } as never);
826821

827-
await expect(session.factory.run("by-name", { args: { value: 1 } })).resolves.toEqual(
828-
{
829-
name: "by-name",
830-
}
831-
);
822+
await expect(session.factory.run("by-name", { args: { value: 1 } })).resolves.toEqual({
823+
name: "by-name",
824+
});
832825
await expect(session.factory.run(factory)).resolves.toEqual({
833826
name: "friendly-run",
834827
});
835-
await expect(
836-
session.factory.run("background", { background: true })
837-
).resolves.toEqual({
828+
await expect(session.factory.run("background", { background: true })).resolves.toEqual({
838829
runId: "run-background",
839830
status: "running",
840831
});

0 commit comments

Comments
 (0)