docs: 基本完成初版数据库设计
This commit is contained in:
@@ -1,19 +1,18 @@
|
||||
import 'reflect-metadata';
|
||||
import assert from 'node:assert/strict';
|
||||
import { test } from 'node:test';
|
||||
import { Test } from '@nestjs/testing';
|
||||
import { AppModule } from '../src/app.module';
|
||||
import { configureApplication } from '../src/app.setup';
|
||||
import { createApplication } from '../src/app.factory';
|
||||
import { AppLogger } from '../src/logging/app-logger';
|
||||
import { testConfig } from './test-config';
|
||||
|
||||
test('服务可以启动并通过带版本前缀的 HTTP 健康检查', async (context) => {
|
||||
const testingModule = await Test.createTestingModule({
|
||||
imports: [AppModule],
|
||||
}).compile();
|
||||
const app = testingModule.createNestApplication({ logger: false });
|
||||
const app = await createApplication(
|
||||
testConfig,
|
||||
new AppLogger('error', () => {}),
|
||||
);
|
||||
context.after(async () => {
|
||||
await app.close();
|
||||
});
|
||||
configureApplication(app);
|
||||
await app.listen(0, '127.0.0.1');
|
||||
const origin = await app.getUrl();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user