initial commit

This commit is contained in:
yiling
2026-05-19 16:05:09 +08:00
commit 9cad96210c
370 changed files with 131609 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
import { describe, expect, it, vi, beforeEach, afterEach } from 'vitest'
import { Hono } from 'hono'
import authnRoute from './authn'
import { teamService } from '@/services/team/team'
describe('authn api', () => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let mockGetSignupInfo: any
beforeEach(() => {
mockGetSignupInfo = vi.spyOn(teamService, 'getSignupInfo')
})
afterEach(() => {
vi.restoreAllMocks()
})
it('GET /signup-info', async () => {
mockGetSignupInfo.mockResolvedValue({
userCount: 5,
enablePublicSignup: true,
})
const app = new Hono().route('/', authnRoute)
const res = await app.request('/signup-info')
expect(res.status).toBe(200)
expect(await res.json()).toEqual({
userCount: 5,
enablePublicSignup: true,
})
})
})