From 99ca005a1218011d6851fa0f1ae561c8c771d897 Mon Sep 17 00:00:00 2001 From: Yapie0 Date: Sat, 13 Jun 2026 00:05:48 +0800 Subject: [PATCH] Skip npm prefix symlink test without permission --- tests/version.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/version.test.ts b/tests/version.test.ts index a032510..d16460c 100644 --- a/tests/version.test.ts +++ b/tests/version.test.ts @@ -39,6 +39,8 @@ function canCreateFileSymlink(): boolean { } } +const fileSymlinkIt = it.skipIf(!canCreateFileSymlink()); + describe("VERSION", () => { it("matches the published package.json version", () => { const pkgPath = join(process.cwd(), "package.json"); @@ -106,8 +108,6 @@ describe("isNpxInstall", () => { }); describe("detectInstallSource", () => { - const fileSymlinkIt = it.skipIf(!canCreateFileSymlink()); - it("identifies npm via lib/node_modules/@carboncode/cli", () => { expect( detectInstallSource("/usr/local/lib/node_modules/@carboncode/cli/dist/cli/index.js"), @@ -228,7 +228,7 @@ describe("detectNpmInstallPrefix", () => { ).toBe("C:/Users/me/AppData/Roaming/npm"); }); - it("resolves a bin symlink before extracting the npm prefix", () => { + fileSymlinkIt("resolves a bin symlink before extracting the npm prefix", () => { const dir = mkdtempSync(join(tmpdir(), "cc-prefix-")); try { const target = join(