diff --git a/.github/workflows/nocobase-test-backend.yml b/.github/workflows/nocobase-test-backend.yml index 0f90c02e9..34e97e4e3 100644 --- a/.github/workflows/nocobase-test-backend.yml +++ b/.github/workflows/nocobase-test-backend.yml @@ -11,6 +11,7 @@ on: - 'packages/core/actions/**' - 'packages/core/database/**' - 'packages/core/server/**' + - 'packages/core/utils/**' - 'packages/plugins/**/src/server/**' - '.github/workflows/nocobase-test-backend.yml' pull_request: @@ -20,6 +21,7 @@ on: - 'packages/core/actions/**' - 'packages/core/database/**' - 'packages/core/server/**' + - 'packages/core/utils/**' - 'packages/plugins/**/src/server/**' - '.github/workflows/nocobase-test-backend.yml' diff --git a/packages/core/utils/src/requireModule.ts b/packages/core/utils/src/requireModule.ts index 8b2d3da31..d3c2ae69b 100644 --- a/packages/core/utils/src/requireModule.ts +++ b/packages/core/utils/src/requireModule.ts @@ -16,6 +16,10 @@ export function requireModule(m: any) { export default requireModule; export async function importModule(m: string) { + if (!process.env.VITEST) { + return requireModule(m); + } + if (path.isAbsolute(m)) { m = pathToFileURL(m).href; }