Skip to content

Commit c44eedc

Browse files
Fix merge conflict
1 parent ac45c75 commit c44eedc

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/client/auth.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ describe('OAuth Authorization', () => {
3939
function mockResponseWithWWWAuthenticate(headerValue: string): Response {
4040
return {
4141
headers: {
42-
get: jest.fn(name => (name === 'WWW-Authenticate' ? headerValue : null))
42+
get: vi.fn(name => (name === 'WWW-Authenticate' ? headerValue : null))
4343
}
4444
} as unknown as Response;
4545
}
@@ -2368,7 +2368,7 @@ describe('OAuth Authorization', () => {
23682368
scope: providedScope
23692369
});
23702370

2371-
const redirectCall = (mockProvider.redirectToAuthorization as jest.Mock).mock.calls[0];
2371+
const redirectCall = (mockProvider.redirectToAuthorization as vi.Mock).mock.calls[0];
23722372
const authUrl: URL = redirectCall[0];
23732373
expect(authUrl.searchParams.get('scope')).toBe(providedScope);
23742374
});
@@ -2396,7 +2396,7 @@ describe('OAuth Authorization', () => {
23962396
serverUrl: 'https://api.example.com/mcp-server'
23972397
});
23982398

2399-
const redirectCall = (mockProvider.redirectToAuthorization as jest.Mock).mock.calls[0];
2399+
const redirectCall = (mockProvider.redirectToAuthorization as vi.Mock).mock.calls[0];
24002400
const authUrl: URL = redirectCall[0];
24012401
expect(authUrl.searchParams.get('scope')).toBe(resourceScope);
24022402
});
@@ -2424,7 +2424,7 @@ describe('OAuth Authorization', () => {
24242424
serverUrl: 'https://api.example.com/mcp-server'
24252425
});
24262426

2427-
const redirectCall = (mockProvider.redirectToAuthorization as jest.Mock).mock.calls[0];
2427+
const redirectCall = (mockProvider.redirectToAuthorization as vi.Mock).mock.calls[0];
24282428
const authUrl: URL = redirectCall[0];
24292429
expect(authUrl.searchParams.get('scope')).toBe(clientMetadataScope);
24302430
});

src/client/streamableHttp.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ describe('StreamableHTTPClientTransport', () => {
601601
id: 'test-id'
602602
};
603603

604-
const fetchMock = global.fetch as jest.Mock;
604+
const fetchMock = global.fetch as vi.Mock;
605605
fetchMock
606606
// First call: returns 403 with insufficient_scope
607607
.mockResolvedValueOnce({
@@ -623,7 +623,7 @@ describe('StreamableHTTPClientTransport', () => {
623623

624624
// Spy on the imported auth function and mock successful authorization
625625
const authModule = await import('./auth.js');
626-
const authSpy = jest.spyOn(authModule, 'auth');
626+
const authSpy = vi.spyOn(authModule, 'auth');
627627
authSpy.mockResolvedValue('AUTHORIZED');
628628

629629
await transport.send(message);
@@ -652,7 +652,7 @@ describe('StreamableHTTPClientTransport', () => {
652652
};
653653

654654
// Mock fetch calls to always return 403 with insufficient_scope
655-
const fetchMock = global.fetch as jest.Mock;
655+
const fetchMock = global.fetch as vi.Mock;
656656
fetchMock.mockResolvedValue({
657657
ok: false,
658658
status: 403,
@@ -665,7 +665,7 @@ describe('StreamableHTTPClientTransport', () => {
665665

666666
// Spy on the imported auth function and mock successful authorization
667667
const authModule = await import('./auth.js');
668-
const authSpy = jest.spyOn(authModule, 'auth');
668+
const authSpy = vi.spyOn(authModule, 'auth');
669669
authSpy.mockResolvedValue('AUTHORIZED');
670670

671671
// First send: should trigger upscoping

0 commit comments

Comments
 (0)