UNPKG

@inlang/paraglide-js

Version:

[![NPM Downloads](https://img.shields.io/npm/dw/%40inlang%2Fparaglide-js?logo=npm&logoColor=red&label=npm%20downloads)](https://www.npmjs.com/package/@inlang/paraglide-js) [![GitHub Issues](https://img.shields.io/github/issues-closed/opral/paraglide-js?lo

27 lines 1.01 kB
import { describe, it, expect } from "vitest"; import { pathExists } from "./exists.js"; import memfs from "memfs"; describe("fileExists", () => { it("returns true if the file does exist", async () => { const fs = memfs.Volume.fromNestedJSON({ "/test.txt": "hello", }).promises; const result = await pathExists("/test.txt", fs); expect(result).toBe(true); }); it("returns false if the file does not exist", async () => { const fs = memfs.Volume.fromNestedJSON({ "/test.txt": "hello", }).promises; const result = await pathExists("/does-not-exist.txt", fs); expect(result).toBe(false); }); it("returns true if the path is a directory", async () => { const fs = memfs.Volume.fromNestedJSON({ "/test/test.txt": "Hello", }).promises; const result = await pathExists("/test", fs); expect(result).toBe(true); }); }); //# sourceMappingURL=exists.test.js.map