mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-24 22:09:08 +08:00
test(server): utils (#10028)
This commit is contained in:
@@ -55,8 +55,9 @@ const test = ava as TestFn<{
|
||||
json: CopilotCheckJsonExecutor;
|
||||
};
|
||||
}>;
|
||||
let userId: string;
|
||||
|
||||
test.beforeEach(async t => {
|
||||
test.before(async t => {
|
||||
const module = await createTestingModule({
|
||||
imports: [
|
||||
ConfigModule.forRoot({
|
||||
@@ -99,17 +100,19 @@ test.beforeEach(async t => {
|
||||
};
|
||||
});
|
||||
|
||||
test.afterEach.always(async t => {
|
||||
await t.context.module.close();
|
||||
});
|
||||
|
||||
let userId: string;
|
||||
test.beforeEach(async t => {
|
||||
const { auth } = t.context;
|
||||
Sinon.restore();
|
||||
const { module, auth, prompt } = t.context;
|
||||
await module.initTestingDB();
|
||||
await prompt.onModuleInit();
|
||||
const user = await auth.signUp('test@affine.pro', '123456');
|
||||
userId = user.id;
|
||||
});
|
||||
|
||||
test.after.always(async t => {
|
||||
await t.context.module.close();
|
||||
});
|
||||
|
||||
// ==================== prompt ====================
|
||||
|
||||
test('should be able to manage prompt', async t => {
|
||||
|
||||
Reference in New Issue
Block a user