Skip to content

Commit

Permalink
fix: test case
Browse files Browse the repository at this point in the history
  • Loading branch information
darkskygit committed Apr 25, 2024
1 parent c983abc commit 9145980
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/backend/server/src/config/affine.self.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ if (env.R2_OBJECT_STORAGE_ACCOUNT_ID) {

AFFiNE.plugins.use('copilot', {
openai: {},
fal: {},
});
AFFiNE.plugins.use('redis');
AFFiNE.plugins.use('payment', {
Expand Down
1 change: 1 addition & 0 deletions packages/backend/server/src/plugins/copilot/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export interface CopilotConfig {
openai: OpenAIClientOptions;
fal: FalConfig;
unsplashKey: string;
test: never;
}

export enum AvailableModels {
Expand Down
7 changes: 5 additions & 2 deletions packages/backend/server/tests/copilot.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import {
createCopilotMessage,
createCopilotSession,
getHistories,
TestProvider,
MockCopilotTestProvider,
textToEventStream,
} from './utils/copilot';

Expand All @@ -52,6 +52,9 @@ test.beforeEach(async t => {
openai: {
apiKey: '1',
},
fal: {
apiKey: '1',
},
},
},
}),
Expand All @@ -75,7 +78,7 @@ test.beforeEach(async t => {
const user = await signUp(app, 'test', 'darksky@affine.pro', '123456');
token = user.token.token;

registerCopilotProvider(TestProvider);
registerCopilotProvider(MockCopilotTestProvider);

await prompt.set(promptName, 'test', [
{ role: 'system', content: 'hello {{word}}' },
Expand Down
3 changes: 3 additions & 0 deletions packages/backend/server/tests/copilot.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ test.beforeEach(async t => {
openai: {
apiKey: '1',
},
fal: {
apiKey: '1',
},
},
},
}),
Expand Down

0 comments on commit 9145980

Please sign in to comment.