| 1 | import { describe, assert, it } from "vite-plus/test"; |
| 2 | import { getLocalFileManagerName, isWindowsPlatform } from "./utils"; |
| 3 | |
| 4 | describe("getLocalFileManagerName", () => { |
| 5 | it.each([ |
| 6 | ["MacIntel", "Finder"], |
| 7 | ["Win32", "File Explorer"], |
| 8 | ["Linux", "Files"], |
| 9 | ])("uses the %s file manager name", (platform, expected) => { |
| 10 | assert.strictEqual(getLocalFileManagerName(platform), expected); |
| 11 | }); |
| 12 | }); |
| 13 | |
| 14 | describe("isWindowsPlatform", () => { |
| 15 | it("matches Windows platform identifiers", () => { |
| 16 | assert.isTrue(isWindowsPlatform("Win32")); |
| 17 | assert.isTrue(isWindowsPlatform("Windows")); |
| 18 | assert.isTrue(isWindowsPlatform("windows_nt")); |
| 19 | }); |
| 20 | |
| 21 | it("does not match darwin", () => { |
| 22 | assert.isFalse(isWindowsPlatform("darwin")); |
| 23 | }); |
| 24 | }); |