mirror of
https://github.com/insistence/RuoYi-Vue3-FastAPI.git
synced 2026-10-15 21:35:31 +00:00
* feat: 新增统一认证中心 * perf: 优化代码 * fix: 修复问题 * perf: 优化页面 * fix: 修复部分接口缺失Request参数的问题 * perf: 优化访问控制机制 * perf: 优化代码 * fix: 修复 Logout Token 缺少 exp * perf&fix: 优化和修复 * perf: 优化代码 * perf: 优化代码 * fix: 修复测试问题
28 lines
1011 B
JavaScript
28 lines
1011 B
JavaScript
import { readdirSync } from 'node:fs'
|
|
import { dirname, join, relative } from 'node:path'
|
|
import { fileURLToPath, pathToFileURL } from 'node:url'
|
|
|
|
const currentDirectory = dirname(fileURLToPath(import.meta.url))
|
|
const requestedSuite = process.argv[2]
|
|
const testRoot = requestedSuite ? join(currentDirectory, requestedSuite) : currentDirectory
|
|
|
|
function collectTestFiles(root) {
|
|
const files = []
|
|
for (const entry of readdirSync(root, { withFileTypes: true })) {
|
|
const entryPath = join(root, entry.name)
|
|
if (entry.isDirectory()) files.push(...collectTestFiles(entryPath))
|
|
if (entry.isFile() && entry.name.endsWith('.test.js')) files.push(entryPath)
|
|
}
|
|
return files.sort()
|
|
}
|
|
|
|
const testFiles = collectTestFiles(testRoot)
|
|
if (testFiles.length === 0) throw new Error('No frontend tests found')
|
|
|
|
for (const testFile of testFiles) {
|
|
await import(pathToFileURL(testFile).href)
|
|
console.log(`ok ${relative(currentDirectory, testFile)}`)
|
|
}
|
|
|
|
console.log(`Frontend tests passed: ${testFiles.length}`)
|