diff --git a/tests/unit/ps1-encoding.test.mjs b/tests/unit/ps1-encoding.test.mjs index efe217d..35ffb21 100644 --- a/tests/unit/ps1-encoding.test.mjs +++ b/tests/unit/ps1-encoding.test.mjs @@ -21,8 +21,9 @@ import { test } from 'node:test'; import assert from 'node:assert/strict'; import { readFileSync, readdirSync } from 'node:fs'; import { join } from 'node:path'; +import { fileURLToPath } from 'node:url'; -const ROOT = new URL('../../', import.meta.url).pathname; +const ROOT = fileURLToPath(new URL('../../', import.meta.url)); const PS_DIR = join(ROOT, 'scripts'); /** 收集仓库里所有需要分发的 .ps1(含子目录) */