mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 12:28:42 +00:00
refactor(server): standalone runtime module (#9120)
This commit is contained in:
@@ -9,7 +9,7 @@ import type { Response } from 'supertest';
|
||||
import supertest from 'supertest';
|
||||
|
||||
import { AppModule, FunctionalityModules } from '../../src/app.module';
|
||||
import { Config, GlobalExceptionFilter } from '../../src/base';
|
||||
import { GlobalExceptionFilter, Runtime } from '../../src/base';
|
||||
import { GqlModule } from '../../src/base/graphql';
|
||||
import { AuthGuard, AuthModule } from '../../src/core/auth';
|
||||
import { UserFeaturesInit1698652531198 } from '../../src/data/migrations/1698652531198-user-features-init';
|
||||
@@ -111,9 +111,9 @@ export async function createTestingModule(
|
||||
if (init) {
|
||||
await m.init();
|
||||
|
||||
const config = m.get(Config);
|
||||
const runtime = m.get(Runtime);
|
||||
// by pass password min length validation
|
||||
await config.runtime.set('auth/password.min', 1);
|
||||
await runtime.set('auth/password.min', 1);
|
||||
}
|
||||
|
||||
return m;
|
||||
@@ -145,9 +145,9 @@ export async function createTestingApp(moduleDef: TestingModuleMeatdata = {}) {
|
||||
|
||||
await app.init();
|
||||
|
||||
const config = app.get(Config);
|
||||
const runtime = app.get(Runtime);
|
||||
// by pass password min length validation
|
||||
await config.runtime.set('auth/password.min', 1);
|
||||
await runtime.set('auth/password.min', 1);
|
||||
|
||||
return {
|
||||
module: m,
|
||||
|
||||
Reference in New Issue
Block a user