From 4bbf7d620dd8284f4b65c7f3258bff852f13fa9b Mon Sep 17 00:00:00 2001 From: DIYgod Date: Mon, 4 Mar 2024 02:27:13 +0800 Subject: [PATCH] fix: test error --- lib/init-routes.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/init-routes.ts b/lib/init-routes.ts index ee510a8c36..d59ccdb2d4 100644 --- a/lib/init-routes.ts +++ b/lib/init-routes.ts @@ -5,6 +5,8 @@ import * as path from 'node:path'; import index from '@/routes/index'; import robotstxt from '@/routes/robots.txt'; +import test from '@/routes/test/router'; + import { getCurrentPath } from '@/utils/helpers'; const __dirname = getCurrentPath(import.meta.url); @@ -15,7 +17,7 @@ type Root = { const routes: Record void> = {}; if (process.env.NODE_ENV === 'test') { - routes.test = (await import('./routes/test/router')).default; + routes.test = test; } else { const imports = directoryImport({ targetDirectoryPath: path.join(__dirname, './routes'),