Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ feat: support clerk as auth provider #2374

Merged
merged 15 commits into from
May 5, 2024
Prev Previous commit
Next Next commit
✅ test: fix test
  • Loading branch information
arvinxx committed May 5, 2024
commit 82fa3c33eb3e21401c16a804832a616fe65d64c8
7 changes: 7 additions & 0 deletions src/app/api/chat/[provider]/route.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,13 @@ describe('POST handler', () => {
});

it('should return an error response when chat completion fails', async () => {
// 设置 getJWTPayload 和 initAgentRuntimeWithUserPayload 的模拟返回值
vi.mocked(getJWTPayload).mockResolvedValueOnce({
accessCode: 'test-access-code',
apiKey: 'test-api-key',
azureApiVersion: 'v1',
});

const mockParams = { provider: 'test-provider' };
const mockChatPayload = { message: 'Hello, world!' };
request = new Request(new URL('https://test.com'), {
Expand Down
Loading