mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 20:38:52 +00:00
feat(server): enable share og information for docs (#7794)
This commit is contained in:
@@ -14,7 +14,13 @@ const test = ava as TestFn<{
|
||||
|
||||
test.before('start app', async t => {
|
||||
// @ts-expect-error override
|
||||
AFFiNE.flavor = { type: 'graphql', graphql: true, sync: false };
|
||||
AFFiNE.flavor = {
|
||||
type: 'graphql',
|
||||
allinone: false,
|
||||
graphql: true,
|
||||
sync: false,
|
||||
renderer: false,
|
||||
} satisfies typeof AFFiNE.flavor;
|
||||
const { app } = await createTestingApp({
|
||||
imports: [buildAppModule()],
|
||||
});
|
||||
|
||||
39
packages/backend/server/tests/app/renderer.e2e.ts
Normal file
39
packages/backend/server/tests/app/renderer.e2e.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
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: 'renderer',
|
||||
allinone: false,
|
||||
graphql: false,
|
||||
sync: false,
|
||||
renderer: true,
|
||||
} satisfies typeof AFFiNE.flavor;
|
||||
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, 'renderer');
|
||||
});
|
||||
@@ -12,7 +12,13 @@ const test = ava as TestFn<{
|
||||
|
||||
test.before('start app', async t => {
|
||||
// @ts-expect-error override
|
||||
AFFiNE.flavor = { type: 'sync', graphql: false, sync: true };
|
||||
AFFiNE.flavor = {
|
||||
type: 'sync',
|
||||
allinone: false,
|
||||
graphql: false,
|
||||
sync: true,
|
||||
renderer: false,
|
||||
} satisfies typeof AFFiNE.flavor;
|
||||
const { app } = await createTestingApp({
|
||||
imports: [buildAppModule()],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user