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

Function appOf

packages/server/test/fs-git.e2e.test.ts:75–102  ·  view source on GitHub ↗
(r: RunningServer)

Source from the content-addressed store, hash-verified

73}
74
75function appOf(r: RunningServer): {
76 inject: (req: unknown) => Promise<{
77 statusCode: number;
78 json: () => unknown;
79 }>;
80} {
81 const app = r.services.invokeFunction((a) => {
82 const gw = a.get(IRestGateway);
83 return gw.app as unknown as {
84 inject: (req: unknown) => Promise<{
85 statusCode: number;
86 json: () => unknown;
87 }>;
88};
89 });
90 // Auto-attach the fixed bearer token so the M5.1 auth hook passes. A
91 // caller-supplied `authorization` header wins, so explicit token tests keep
92 // working; every other header (Range, content-type, …) is preserved.
93 return {
94 inject(req: unknown) {
95 const q = req as { headers?: Record<string, string | string[] | undefined> };
96 return app.inject({
97 ...q,
98 headers: { authorization: 'Bearer test-token', ...q.headers },
99 });
100 },
101 };
102}
103
104function envelopeOf<T>(body: unknown): {
105 code: number;

Callers 2

createSessionFunction · 0.70
fs-git.e2e.test.tsFile · 0.70

Calls 2

invokeFunctionMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected