|
@@ -6,7 +6,7 @@ import { UserEntity, Role } from '@d8d/user-module';
|
|
|
import { File } from '@d8d/file-module';
|
|
import { File } from '@d8d/file-module';
|
|
|
import { Supplier } from '@d8d/supplier-module';
|
|
import { Supplier } from '@d8d/supplier-module';
|
|
|
import { Merchant } from '@d8d/merchant-module';
|
|
import { Merchant } from '@d8d/merchant-module';
|
|
|
-import publicGoodsRandom from '../../src/routes/public-goods-random.js';
|
|
|
|
|
|
|
+import { publicGoodsRandomRoutes } from '../../src/routes/public-goods-random';
|
|
|
import { Goods, GoodsCategory } from '../../src/entities';
|
|
import { Goods, GoodsCategory } from '../../src/entities';
|
|
|
|
|
|
|
|
// 设置集成测试钩子
|
|
// 设置集成测试钩子
|
|
@@ -15,7 +15,7 @@ setupIntegrationDatabaseHooksWithEntities([
|
|
|
])
|
|
])
|
|
|
|
|
|
|
|
describe('公开随机商品API集成测试', () => {
|
|
describe('公开随机商品API集成测试', () => {
|
|
|
- let client: ReturnType<typeof testClient<typeof publicGoodsRandom>>;
|
|
|
|
|
|
|
+ let client: ReturnType<typeof testClient<typeof publicGoodsRandomRoutes>>;
|
|
|
let testUser: UserEntity;
|
|
let testUser: UserEntity;
|
|
|
let testSupplier: Supplier;
|
|
let testSupplier: Supplier;
|
|
|
let testMerchant: Merchant;
|
|
let testMerchant: Merchant;
|
|
@@ -24,7 +24,7 @@ describe('公开随机商品API集成测试', () => {
|
|
|
|
|
|
|
|
beforeEach(async () => {
|
|
beforeEach(async () => {
|
|
|
// 创建测试客户端
|
|
// 创建测试客户端
|
|
|
- client = testClient(publicGoodsRandom);
|
|
|
|
|
|
|
+ client = testClient(publicGoodsRandomRoutes);
|
|
|
|
|
|
|
|
// 获取数据源
|
|
// 获取数据源
|
|
|
const dataSource = await IntegrationTestDatabase.getDataSource();
|
|
const dataSource = await IntegrationTestDatabase.getDataSource();
|
|
@@ -294,7 +294,7 @@ describe('公开随机商品API集成测试', () => {
|
|
|
]);
|
|
]);
|
|
|
|
|
|
|
|
// 验证所有请求都成功
|
|
// 验证所有请求都成功
|
|
|
- responses.forEach(response => {
|
|
|
|
|
|
|
+ responses.forEach((response: any) => {
|
|
|
expect(response.status).toBe(200);
|
|
expect(response.status).toBe(200);
|
|
|
});
|
|
});
|
|
|
|
|
|