test: fix debug test case

This commit is contained in:
DIYgod
2019-09-04 21:56:16 +08:00
parent 4bc0a56064
commit 16263b020c
5 changed files with 24 additions and 10 deletions

View File

@@ -19,14 +19,14 @@ module.exports = async (ctx) => {
const hotRoutes = routes.slice(0, 30);
let hotRoutesValue = '';
hotRoutes.forEach((item) => {
hotRoutesValue += `${ctx.debug.routes[item]}&nbsp;&nbsp;${item}<br>`;
hotRoutesValue += `${ctx.debug.routes[item]} ${item}<br>`;
});
const paths = Object.keys(ctx.debug.paths).sort((a, b) => ctx.debug.paths[b] - ctx.debug.paths[a]);
const hotPaths = paths.slice(0, 30);
let hotPathsValue = '';
hotPaths.forEach((item) => {
hotPathsValue += `${ctx.debug.paths[item]}&nbsp;&nbsp;${item}<br>`;
hotPathsValue += `${ctx.debug.paths[item]} ${item}<br>`;
});
let hotErrorRoutesValue = '';
@@ -34,7 +34,7 @@ module.exports = async (ctx) => {
const errorRoutes = Object.keys(ctx.debug.errorRoutes).sort((a, b) => ctx.debug.errorRoutes[b] - ctx.debug.errorRoutes[a]);
const hotErrorRoutes = errorRoutes.slice(0, 30);
hotErrorRoutes.forEach((item) => {
hotErrorRoutesValue += `${ctx.debug.errorRoutes[item]}&nbsp;&nbsp;${item}<br>`;
hotErrorRoutesValue += `${ctx.debug.errorRoutes[item]} ${item}<br>`;
});
}
@@ -43,7 +43,7 @@ module.exports = async (ctx) => {
const errorPaths = Object.keys(ctx.debug.errorPaths).sort((a, b) => ctx.debug.errorPaths[b] - ctx.debug.errorPaths[a]);
const hotErrorPaths = errorPaths.slice(0, 30);
hotErrorPaths.forEach((item) => {
hotErrorPathsValue += `${ctx.debug.errorPaths[item]}&nbsp;&nbsp;${item}<br>`;
hotErrorPathsValue += `${ctx.debug.errorPaths[item]} ${item}<br>`;
});
}
@@ -51,7 +51,7 @@ module.exports = async (ctx) => {
const hotIPs = ips.slice(0, 50);
let hotIPsValue = '';
hotIPs.forEach((item) => {
hotIPsValue += `${ctx.debug.ips[item]}&nbsp;&nbsp;${item}<br>`;
hotIPsValue += `${ctx.debug.ips[item]} ${item}<br>`;
});
let showDebug;