MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / appOf

Function appOf

packages/server/test/guiStore.e2e.test.ts:45–63  ·  view source on GitHub ↗
(r: RunningServer)

Source from the content-addressed store, hash-verified

43}
44
45function appOf(r: RunningServer): {
46 inject: (req: unknown) => Promise<{ statusCode: number; json: () => unknown }>;
47} {
48 const app = r.services.invokeFunction((a) => {
49 const gw = a.get(IRestGateway);
50 return gw.app as unknown as {
51 inject: (req: unknown) => Promise<{ statusCode: number; json: () => unknown }>;
52 };
53 });
54 return {
55 inject(req: unknown) {
56 const q = req as { headers?: Record<string, string | string[] | undefined> };
57 return app.inject({
58 ...q,
59 headers: { authorization: 'Bearer test-token', ...q.headers },
60 });
61 },
62 };
63}
64
65function envelopeOf<T>(body: unknown): {
66 code: number;

Callers 1

Calls 2

invokeFunctionMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected