feat: 添加路由描述和更新运行代码参数,优化测试用例
This commit is contained in:
@@ -4,7 +4,8 @@ const app = new Mini();
|
|||||||
|
|
||||||
app.route({
|
app.route({
|
||||||
path: 'main',
|
path: 'main',
|
||||||
id: 'abc'
|
id: 'abc',
|
||||||
|
description: '这是一个测试的 main 路由'
|
||||||
}).define(async (ctx) => {
|
}).define(async (ctx) => {
|
||||||
ctx.body = {
|
ctx.body = {
|
||||||
a: '123'
|
a: '123'
|
||||||
|
|||||||
@@ -52,6 +52,8 @@ 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'
|
// path: 'main'
|
||||||
// id: 'abc'
|
// id: 'abc'
|
||||||
|
path: 'router',
|
||||||
|
key: 'list'
|
||||||
})
|
})
|
||||||
|
|
||||||
console.log('res', res)
|
console.log('res', res.data.data.list)
|
||||||
Reference in New Issue
Block a user