Skip to content

Commit

Permalink
fix hidden tests on macos
Browse files Browse the repository at this point in the history
  • Loading branch information
mceachen committed Dec 1, 2024
1 parent 2b604bf commit b6eacc0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/__tests__/hidden.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
isHiddenRecursive,
setHidden,
} from "../index.js";
import { isMacOS, isWindows } from "../platform.js";
import { isLinux, isMacOS, isWindows } from "../platform.js";
import { validateHidden } from "../test-utils/hidden-tests.js";
import { systemDrive, tmpDirNotHidden } from "../test-utils/platform.js";

Expand Down Expand Up @@ -189,7 +189,7 @@ describe("hidden file tests", () => {
}
}

if (!isWindows) {
if (isLinux) {
it("should throw error when using systemFlag method on Linux", async () => {
const testFile = path.join(tempDir, "linux-error-test.txt");
await fs.writeFile(testFile, "test");
Expand All @@ -198,7 +198,9 @@ describe("hidden file tests", () => {
/not supported/i,
);
});
}

if (!isWindows) {
it("should correctly handle multiple dot prefixes when hiding", async () => {
const testFile = path.join(tempDir, ".already-hidden.txt");
await fs.writeFile(testFile, "test");
Expand Down

0 comments on commit b6eacc0

Please sign in to comment.