Skip to content

Commit 6dba08f

Browse files
Fix incomplete vitest migration in auth.test.ts
Replace remaining Jest-specific APIs with Vitest equivalents: - jest.Mock -> Mock (already imported from vitest) - jest.fn() -> vi.fn() - Add non-null assertion for TypeScript strict null check
1 parent b83e039 commit 6dba08f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/client/auth.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1650,9 +1650,9 @@ describe('OAuth Authorization', () => {
16501650
});
16511651

16521652
// Mock provider methods
1653-
(mockProvider.clientInformation as jest.Mock).mockResolvedValue(undefined);
1654-
(mockProvider.tokens as jest.Mock).mockResolvedValue(undefined);
1655-
mockProvider.saveClientInformation = jest.fn();
1653+
(mockProvider.clientInformation as Mock).mockResolvedValue(undefined);
1654+
(mockProvider.tokens as Mock).mockResolvedValue(undefined);
1655+
mockProvider.saveClientInformation = vi.fn();
16561656

16571657
// Call the auth function with a server URL that has a path
16581658
const result = await auth(mockProvider, {
@@ -1668,7 +1668,7 @@ describe('OAuth Authorization', () => {
16681668
call[0].toString().includes('/.well-known/oauth-authorization-server')
16691669
);
16701670
expect(authServerCall).toBeDefined();
1671-
expect(authServerCall[0].toString()).toBe('https://resource.example.com/.well-known/oauth-authorization-server');
1671+
expect(authServerCall![0].toString()).toBe('https://resource.example.com/.well-known/oauth-authorization-server');
16721672
});
16731673

16741674
it('passes resource parameter through authorization flow', async () => {

0 commit comments

Comments
 (0)