Files
PlantAI-rag-new/tests/frontend/unit/b3/vitest.config.js
T
jerryandClaude Fable 5 0875bb036c P0/M1: 四部分重构——frontend→ui、backend→sdk 改名 + 引用修复 + 骨架
- git mv 保留历史:ui/(Vue3+Vite)、sdk/(BFF 中间层)
- 路径语义修正:db_path/figures_cache 改相对 sdk/(BFF cwd),
  历史库 sdk/backend/data 迁移至 sdk/data/(会话/图片缓存无损)
- 引用修复 ~15 处:config.py、deploy/*.sh、vitest/playwright 配置、
  单测导入路径、docs、README、gitignore、.env.example
- 骨架:agent/{qa,methodology,legacy-rag,vendor}、knowledge/manifest.yaml、
  tooling/{compile,kb,crypto,assemble,audit,tools,scripts} + README
- 门禁验证:sdk pytest 125 通过、ui vitest 158 通过、
  生产 BFF 脚本重启四上游全绿 + 静态托管 + 会话库无损

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-31 12:56:47 +08:00

29 lines
1.2 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// vitest.config.js —— B3 单测局部配置(B3 归属,位于 tests/frontend/unit/b3/)
// B1 尚未交付 ui/vitest.config.js,此处提供最小可用配置保证 B3 单测可独立运行。
// 因本目录在 ui/ 之外,node_modules 解析与别名均需显式指到 ui/node_modules。
// 待 B1 总配置就绪后,PM 集成时可删除本文件,改用统一配置(需 include 覆盖本目录)。
import { fileURLToPath } from 'node:url';
import path from 'node:path';
import { defineConfig } from '../../../../ui/node_modules/vitest/dist/config.js';
import vue from '../../../../ui/node_modules/@vitejs/plugin-vue/dist/index.mjs';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const nm = (rel) => path.resolve(__dirname, '../../../../ui/node_modules', rel);
export default defineConfig({
plugins: [vue()],
resolve: {
alias: {
vue: nm('vue/dist/vue.runtime.esm-bundler.js'),
pinia: nm('pinia/dist/pinia.mjs'),
vitest: nm('vitest/dist/index.js'),
'@vue/test-utils': nm('@vue/test-utils/dist/vue-test-utils.esm-bundler.mjs'),
},
},
test: {
environment: 'jsdom',
include: ['**/*.test.js'],
globals: false,
},
});