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 <amp@ampcode.com>
This commit is contained in:
Kevin Stillhammer
2026-09-17 13:32:54 +00:00
committed by GitHub
co-authored by Amp
parent cc56f639e4
commit 6776b96909
2 changed files with 5 additions and 3 deletions
+2 -1
View File
@@ -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",
+3 -2
View File
@@ -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}"),
);
});
});