|
|
@@ -1,13 +1,12 @@
|
|
|
import { UserService } from '../user.service';
|
|
|
-import { DataSource, Repository } from 'typeorm';
|
|
|
+import { DataSource } from 'typeorm';
|
|
|
import { UserEntity as User } from '../user.entity';
|
|
|
-import { Role } from '../role.entity';
|
|
|
import * as bcrypt from 'bcrypt';
|
|
|
import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
|
|
|
|
|
|
// Mock TypeORM 数据源和仓库
|
|
|
vi.mock('typeorm', async (importOriginal) => {
|
|
|
- const actual = await importOriginal()
|
|
|
+ const actual = await importOriginal() as any
|
|
|
return {
|
|
|
...actual,
|
|
|
DataSource: vi.fn().mockImplementation(() => ({
|