MCPcopy Index your code
hub / github.com/modelcontextprotocol/typescript-sdk / createMockProvider

Function createMockProvider

test/client/auth.test.ts:1046–1068  ·  view source on GitHub ↗
(overrides: Partial<OAuthClientProvider> = {})

Source from the content-addressed store, hash-verified

1044 };
1045
1046 function createMockProvider(overrides: Partial<OAuthClientProvider> = {}): OAuthClientProvider {
1047 return {
1048 get redirectUrl() {
1049 return 'http://localhost:3000/callback';
1050 },
1051 get clientMetadata() {
1052 return {
1053 redirect_uris: ['http://localhost:3000/callback'],
1054 client_name: 'Test Client'
1055 };
1056 },
1057 clientInformation: vi.fn().mockResolvedValue({
1058 client_id: 'test-client-id',
1059 client_secret: 'test-client-secret'
1060 }),
1061 tokens: vi.fn().mockResolvedValue(undefined),
1062 saveTokens: vi.fn(),
1063 redirectToAuthorization: vi.fn(),
1064 saveCodeVerifier: vi.fn(),
1065 codeVerifier: vi.fn(),
1066 ...overrides
1067 };
1068 }
1069
1070 beforeEach(() => {
1071 vi.clearAllMocks();

Callers 1

auth.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…