chore: 更新依赖配置与测试工具

- 添加 uni-cloud 等云开发依赖
- 更新 vitest 测试配置,支持云函数 mock
- 扩展 uni-app mock 支持云函数调用
- 添加每日推送算法测试脚本
This commit is contained in:
2026-08-13 08:06:28 +08:00
parent f4c1bd957c
commit 17ada52928
5 changed files with 1870 additions and 33 deletions
File diff suppressed because it is too large Load Diff
@@ -15,6 +15,7 @@
"test:e2e:ui": "playwright test --ui"
},
"dependencies": {
"@everything-suitable/algorithm": "file:../packages/algorithm",
"@dcloudio/uni-app": "^3.0.0-alpha-5000820260420001",
"@dcloudio/uni-components": "^3.0.0-alpha-5000820260420001",
"@dcloudio/uni-h5": "^3.0.0-alpha-5000820260420001",
@@ -1,4 +1,11 @@
export const onShow = vi.fn()
const onShowCallbacks: Array<() => void> = []
export const onShow = vi.fn((cb: () => void) => {
onShowCallbacks.push(cb)
})
export function triggerOnShow() {
onShowCallbacks.forEach((cb) => cb())
onShowCallbacks.length = 0
}
export const onHide = vi.fn()
export const onLaunch = vi.fn()
export const onLoad = vi.fn()
@@ -1,6 +1,7 @@
import { vi } from 'vitest'
const uni = {
setNavigationBarTitle: vi.fn(),
getStorageSync: vi.fn((key: string) => {
const store: Record<string, string> = (globalThis as any).__uniStorage__ ?? {}
return store[key] ?? ''