feat: 添加路由描述和更新运行代码参数,优化测试用例
This commit is contained in:
@@ -4,7 +4,8 @@ const app = new Mini();
|
||||
|
||||
app.route({
|
||||
path: 'main',
|
||||
id: 'abc'
|
||||
id: 'abc',
|
||||
description: '这是一个测试的 main 路由'
|
||||
}).define(async (ctx) => {
|
||||
ctx.body = {
|
||||
a: '123'
|
||||
|
||||
@@ -49,9 +49,11 @@ export const runCode = async (tsPath: string, params: RunCodeParams = {}): Promi
|
||||
});
|
||||
}
|
||||
import path from 'node:path'
|
||||
const res =await runCode(path.join(process.cwd(), './src/test/mini.ts'), {
|
||||
const res = await runCode(path.join(process.cwd(), './src/test/mini.ts'), {
|
||||
// path: 'main'
|
||||
// id: 'abc'
|
||||
path: 'router',
|
||||
key: 'list'
|
||||
})
|
||||
|
||||
console.log('res', res)
|
||||
console.log('res', res.data.data.list)
|
||||
Reference in New Issue
Block a user