Skip to content

Commit a971c2b

Browse files
test(lint): shader lint tests pass on macOS, where the temp folder is a symlink (#5851)
projectShaders reports real paths, and macOS's temp folder is /var, a link to /private/var, so the tests' expected paths never matched there. The fixture root is now the real path.
1 parent 18fc390 commit a971c2b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎packages/lint/src/projectShaders.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { afterEach, expect, it } from "vitest";
2-
import { mkdirSync, mkdtempSync, rmSync, symlinkSync, writeFileSync } from "node:fs";
2+
import { mkdirSync, mkdtempSync, realpathSync, rmSync, symlinkSync, writeFileSync } from "node:fs";
33
import { tmpdir } from "node:os";
44
import { dirname, join } from "node:path";
55
import { lintProject } from "./project";
@@ -13,7 +13,7 @@ gl_FragColor=vec4(vec3(f),1.0);
1313
}\`;`;
1414

1515
function project(files: Record<string, string>) {
16-
const root = mkdtempSync(join(tmpdir(), "hf-shader-lint-"));
16+
const root = realpathSync(mkdtempSync(join(tmpdir(), "hf-shader-lint-")));
1717
dirs.push(root);
1818
for (const [file, text] of Object.entries(files)) {
1919
mkdirSync(dirname(join(root, file)), { recursive: true });

0 commit comments

Comments
 (0)