chore: 初始化 monorepo 脚手架与代码骨架
- Bun workspaces:apps/web(Vue 3.5 + Vite 8 + naive-ui)· apps/server(Hono 4.13 + Drizzle)· packages/shared(契约类型) - 代码骨架:四表 Drizzle schema · 11 个端点占位(501)· 管理面口令中间件 · 同步引擎占位(5 分钟 tick + 防重入) - 命令链:dev / build / test / lint / type-check / db:*(见 AGENTS.md)
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
|
||||
import router from '@/router'
|
||||
|
||||
describe('router', () => {
|
||||
it('路由表包含查看面与管理面三页', () => {
|
||||
const paths = router.getRoutes().map((r) => r.path)
|
||||
for (const p of ['/usage-log', '/manage/api-keys', '/manage/purchases', '/manage/qpu']) {
|
||||
expect(paths).toContain(p)
|
||||
}
|
||||
})
|
||||
|
||||
it(
|
||||
'根路径重定向到 /usage-log(真实导航;首次含懒加载组件转换,放宽超时)',
|
||||
async () => {
|
||||
await router.push('/')
|
||||
expect(router.currentRoute.value.path).toBe('/usage-log')
|
||||
},
|
||||
20_000,
|
||||
)
|
||||
})
|
||||
Reference in New Issue
Block a user