mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-26 09:29:23 +00:00
refactor(transcode): relocate TranscodeService to core and flatten API package
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import { describe, expect, it, vi, beforeEach, afterEach } from 'vitest'
|
||||
import { Hono } from 'hono'
|
||||
import authnRoute from './authn'
|
||||
import { teamService } from '@shumai/core/src/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,
|
||||
})
|
||||
|
||||
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,
|
||||
})
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user