|
@@ -1,6 +1,5 @@
|
|
|
import { describe, it, expect, beforeEach, vi } from 'vitest';
|
|
import { describe, it, expect, beforeEach, vi } from 'vitest';
|
|
|
import { DisabledPersonService } from '../../src/services/disabled-person.service';
|
|
import { DisabledPersonService } from '../../src/services/disabled-person.service';
|
|
|
-import { DisabledPerson } from '../../src/entities/disabled-person.entity';
|
|
|
|
|
import { Repository, DataSource } from 'typeorm';
|
|
import { Repository, DataSource } from 'typeorm';
|
|
|
import { OrderPerson } from '@d8d/allin-order-module/entities';
|
|
import { OrderPerson } from '@d8d/allin-order-module/entities';
|
|
|
|
|
|
|
@@ -34,12 +33,12 @@ describe('DisabledPersonService - findPersonsWithCompany', () => {
|
|
|
|
|
|
|
|
// 创建 DataSource 模拟
|
|
// 创建 DataSource 模拟
|
|
|
mockDataSource = {
|
|
mockDataSource = {
|
|
|
- getRepository: vi.fn((entity) => {
|
|
|
|
|
|
|
+ getRepository: vi.fn((entity: any) => {
|
|
|
if (entity === OrderPerson) {
|
|
if (entity === OrderPerson) {
|
|
|
return mockOrderPersonRepository;
|
|
return mockOrderPersonRepository;
|
|
|
}
|
|
}
|
|
|
return {};
|
|
return {};
|
|
|
- })
|
|
|
|
|
|
|
+ }) as any
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
// @ts-ignore - 创建实例
|
|
// @ts-ignore - 创建实例
|