test: 按当前schema快速创建隔离测试库

This commit is contained in:
margrop
2026-10-26 11:09:26 +08:00
parent b12cffcf0e
commit 018c2eccce

View File

@@ -31,7 +31,8 @@ const get = (query = '') => GET(new Request(`http://localhost/api/error-items/li
describe('错题列表大字段与打印回归(真实 SQLite)', () => {
beforeAll(async () => {
execFileSync(process.execPath, [path.resolve('node_modules/prisma/build/index.js'), 'migrate', 'deploy'], {
// 一次创建独立测试库;正式迁移由生产构建流程验证。
execFileSync(process.execPath, [path.resolve('node_modules/prisma/build/index.js'), 'db', 'push', '--skip-generate'], {
env: { ...process.env, DATABASE_URL: state.databaseUrl },
stdio: 'pipe',
});