test(server): add MockJobQueue (#11032)

This commit is contained in:
fengmk2
2025-03-21 04:08:29 +00:00
parent 4ed2c9bd81
commit 55a60906a5
6 changed files with 61 additions and 8 deletions
@@ -5,6 +5,7 @@ import type { TestFn } from 'ava';
import ava from 'ava';
import Sinon from 'sinon';
import { JobQueue } from '../base';
import { ConfigModule } from '../base/config';
import { AuthService } from '../core/auth';
import { WorkspaceModule } from '../core/workspaces';
@@ -88,6 +89,10 @@ test.before(async t => {
WorkspaceModule,
CopilotModule,
],
tapModule: m => {
// use real JobQueue for testing
m.overrideProvider(JobQueue).useClass(JobQueue);
},
});
const auth = app.get(AuthService);