mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-08-30 16:55:08 +08:00
fix: test error
This commit is contained in:
+3
-1
@@ -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'),
|
||||
|
||||
Reference in New Issue
Block a user