refactor(server): standalone runtime module (#9120)

This commit is contained in:
forehalo
2024-12-13 06:27:14 +00:00
parent 4c23991047
commit 81c68032e1
18 changed files with 85 additions and 75 deletions
+4 -12
View File
@@ -4,7 +4,7 @@ import { INestApplication } from '@nestjs/common';
import type { TestFn } from 'ava';
import ava from 'ava';
import { Config, ConfigModule } from '../src/base/config';
import { Runtime } from '../src/base';
import { AuthService } from '../src/core/auth/service';
import {
FeatureManagementService,
@@ -26,15 +26,7 @@ const test = ava as TestFn<{
test.beforeEach(async t => {
const { app } = await createTestingApp({
imports: [
ConfigModule.forRoot({
server: {
host: 'example.org',
https: true,
},
}),
FeatureModule,
],
imports: [FeatureModule],
providers: [WorkspaceResolver],
tapModule: module => {
module
@@ -43,8 +35,8 @@ test.beforeEach(async t => {
},
});
const config = app.get(Config);
await config.runtime.set('flags/earlyAccessControl', true);
const runtime = app.get(Runtime);
await runtime.set('flags/earlyAccessControl', true);
t.context.app = app;
t.context.auth = app.get(AuthService);
t.context.feature = app.get(FeatureService);