fix: resolve lint and typecheck errors in API and Authz tests

This commit is contained in:
yiling
2026-05-26 10:27:07 +08:00
parent 1bfbcc0df3
commit 6dd990474e
7 changed files with 115 additions and 95 deletions
+5 -2
View File
@@ -5,7 +5,10 @@ import { notificationService } from '@/services/notification/notification'
import { authzService, Permission, ResourceType } from '@/services/authz/authz'
vi.mock('@/api/middleware/auth', () => ({
authMiddleware: async (c: Context, next: Next) => {
authMiddleware: async (
c: Context<{ Variables: { user: { id: string; name: string } } }>,
next: Next,
) => {
c.set('user', { id: 'user1', name: 'Test User' })
await next()
},
@@ -15,7 +18,7 @@ vi.mock('@/services/authz/authz')
vi.mock('@/services/notification/notification')
describe('notification api', () => {
const app = new Hono()
const app = new Hono<{ Variables: { user: { id: string; name: string } } }>()
.use('*', async (c, next) => {
c.set('user', { id: 'user1', name: 'Test User' })
await next()