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 26, 2024
1 parent 794244b commit d71600c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/backend/server/tests/copilot.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ import type { TestFn } from 'ava';
import ava from 'ava';
import Sinon from 'sinon';

import { AppModule } from '../src/app.module';
import { AuthService } from '../src/core/auth';
import { WorkspaceModule } from '../src/core/workspaces';
import { ConfigModule } from '../src/fundamentals/config';
import { CopilotModule } from '../src/plugins/copilot';
import { PromptService } from '../src/plugins/copilot/prompt';
import {
CopilotProviderService,
Expand Down Expand Up @@ -45,7 +46,6 @@ const test = ava as TestFn<{
test.beforeEach(async t => {
const { app } = await createTestingApp({
imports: [
AppModule,
ConfigModule.forRoot({
plugins: {
copilot: {
Expand All @@ -58,6 +58,8 @@ test.beforeEach(async t => {
},
},
}),
WorkspaceModule,
CopilotModule,
],
});

Expand Down Expand Up @@ -208,7 +210,7 @@ test('should be able to chat with api', async t => {
const ret2 = await chatWithTextStream(app, token, sessionId, messageId);
t.is(
ret2,
textToEventStream('generate text to text stream', sessionId),
textToEventStream('generate text to text stream', messageId),
'should be able to chat with text stream'
);

Expand All @@ -217,7 +219,7 @@ test('should be able to chat with api', async t => {
ret3,
textToEventStream(
['https://example.com/image.jpg'],
sessionId,
messageId,
'attachment'
),
'should be able to chat with images'
Expand Down

0 comments on commit d71600c

Please sign in to comment.