MCPcopy Index your code
hub / github.com/sourcebot-dev/sourcebot / invokeMiddleware

Function invokeMiddleware

packages/backend/src/errors.test.ts:10–24  ·  view source on GitHub ↗
(response: Response)

Source from the content-addressed store, hash-verified

8// return the thrown error (or null if it didn't throw). Validates the actual
9// contract — not a hand-rolled mock of what we hope the middleware produces.
10const invokeMiddleware = async (response: Response): Promise<unknown> => {
11 try {
12 await throwOnHttpError.onResponse!({
13 request: new Request('https://example.test'),
14 response,
15 schemaPath: '/path',
16 params: {},
17 options: {} as never,
18 id: 'test',
19 });
20 return null;
21 } catch (e) {
22 return e;
23 }
24};
25
26describe('isUnauthorized', () => {
27 test('Octokit RequestError with status 401', () => {

Callers 1

errors.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected