fix: test error

This commit is contained in:
DIYgod
2024-03-04 02:27:13 +08:00
parent 9f69cffb82
commit 4bbf7d620d
+3 -1
View File
@@ -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<string, (root: Root) => 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'),