From 6776b969097d5da0423e7ed8bbda68e2c8b92b60 Mon Sep 17 00:00:00 2001 From: Kevin Stillhammer Date: Thu, 17 Sep 2026 15:32:54 +0200 Subject: [PATCH] test: fix Windows path assertions (#422) Amp-Thread-ID: https://ampcode.com/threads/T-01a0af62-d8be-7209-b38b-950badf6ef76 Closes: #394 Co-authored-by: Amp --- __tests__/download/download-version.test.ts | 3 ++- __tests__/utils/source-input.test.ts | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/__tests__/download/download-version.test.ts b/__tests__/download/download-version.test.ts index 50c49c4..228fa6c 100644 --- a/__tests__/download/download-version.test.ts +++ b/__tests__/download/download-version.test.ts @@ -1,3 +1,4 @@ +import * as path from "node:path"; import { beforeEach, describe, expect, it, jest } from "@jest/globals"; import * as semver from "semver"; @@ -450,7 +451,7 @@ describe("download-version", () => { expect(mockExtractTar).toHaveBeenCalledWith("/tmp/downloaded"); expect(mockCacheDir).toHaveBeenCalledWith( - "/tmp/extracted/ruff-x86_64-unknown-linux-gnu", + path.join("/tmp/extracted", "ruff-x86_64-unknown-linux-gnu"), "ruff", "0.15.8", "x86_64", diff --git a/__tests__/utils/source-input.test.ts b/__tests__/utils/source-input.test.ts index 89acf54..00ee19e 100644 --- a/__tests__/utils/source-input.test.ts +++ b/__tests__/utils/source-input.test.ts @@ -17,6 +17,7 @@ const { const { findPyprojectToml } = await import("../../src/utils/pyproject-finder"); let tempDir: string | undefined; +const symlinkTest = process.platform === "win32" ? it.skip : it; afterEach(async () => { if (tempDir !== undefined) { @@ -177,7 +178,7 @@ describe("expandSourceInput", () => { ]); }); - it("does not traverse symlinked directories", async () => { + symlinkTest("does not traverse symlinked directories", async () => { const projectDir = await createTempProject(); const externalDir = path.join(projectDir, "external"); const symlinkPath = path.join(projectDir, "src", "linked"); @@ -368,7 +369,7 @@ describe("getSourceBasePath", () => { it("does not treat brace expansion as glob syntax", async () => { await expect(getSourceBasePath("src/{a,b}/*.py")).resolves.toBe( - "src/{a,b}", + path.join("src", "{a,b}"), ); }); });