mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-27 03:14:11 +00:00
refactor(api): enforce layered architecture by moving db queries to core services
This commit is contained in:
@@ -41,17 +41,11 @@ vi.mock('@shumai/core/src/auditLog/auditLog', () => ({
|
||||
},
|
||||
}))
|
||||
|
||||
vi.mock('@shumai/db', async (importOriginal) => {
|
||||
const actual = await importOriginal<typeof import('@shumai/db')>()
|
||||
return {
|
||||
...actual,
|
||||
prisma: {
|
||||
project: {
|
||||
findUnique: vi.fn().mockResolvedValue({ teamId: 't1' }),
|
||||
},
|
||||
},
|
||||
}
|
||||
})
|
||||
vi.mock('@shumai/core/src/project/project', () => ({
|
||||
projectService: {
|
||||
getProjectTeam: vi.fn().mockResolvedValue('t1'),
|
||||
},
|
||||
}))
|
||||
|
||||
describe('Share API', () => {
|
||||
const app = new Hono()
|
||||
|
||||
Reference in New Issue
Block a user