mirror of
https://github.com/toeverything/AFFiNE.git
synced 2025-01-03 18:43:17 +03:00
34 lines
789 B
TypeScript
34 lines
789 B
TypeScript
import type { INestApplication } from '@nestjs/common';
|
|
import type { TestFn } from 'ava';
|
|
import ava from 'ava';
|
|
import request from 'supertest';
|
|
|
|
import { buildAppModule } from '../../src/app.module';
|
|
import { createTestingApp } from '../utils';
|
|
|
|
const test = ava as TestFn<{
|
|
app: INestApplication;
|
|
}>;
|
|
|
|
test.before('start app', async t => {
|
|
// @ts-expect-error override
|
|
AFFiNE.flavor = { type: 'sync', graphql: false, sync: true };
|
|
const { app } = await createTestingApp({
|
|
imports: [buildAppModule()],
|
|
});
|
|
|
|
t.context.app = app;
|
|
});
|
|
|
|
test.after.always(async t => {
|
|
await t.context.app.close();
|
|
});
|
|
|
|
test('should init app', async t => {
|
|
const res = await request(t.context.app.getHttpServer())
|
|
.get('/info')
|
|
.expect(200);
|
|
|
|
t.is(res.body.flavor, 'sync');
|
|
});
|