Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

fileExplorerLabel.test.ts

38 lines1.1 KB

1import { describe, expect, it } from "vite-plus/test";
2​
3import {
4 revealInFileExplorerLabel,
5 revealInFileExplorerLabelForKind,
6 revealInFileExplorerLabelForOs,
7} from "./fileExplorerLabel";
8​
9describe("revealInFileExplorerLabel", () => {
10 it.each([
11 ["MacIntel", "Reveal in Finder"],
12 ["Win32", "Reveal in File Explorer"],
13 ["Linux x86_64", "Reveal in Files"],
14 ])("maps %s to %s", (platform, expected) => {
15 expect(revealInFileExplorerLabel(platform)).toBe(expected);
16 });
17});
18​
19describe("revealInFileExplorerLabelForOs", () => {
20 it.each([
21 ["darwin", "Reveal in Finder"],
22 ["windows", "Reveal in File Explorer"],
23 ["linux", "Reveal in Files"],
24 ["unknown", "Reveal in Files"],
25 ] as const)("maps %s to %s", (os, expected) => {
26 expect(revealInFileExplorerLabelForOs(os)).toBe(expected);
27 });
28});
29​
30describe("revealInFileExplorerLabelForKind", () => {
31 it.each([
32 ["finder", "Reveal in Finder"],
33 ["file-explorer", "Reveal in File Explorer"],
34 ["files", "Reveal in Files"],
35 ] as const)("maps %s to %s", (kind, expected) => {
36 expect(revealInFileExplorerLabelForKind(kind)).toBe(expected);
37 });
38});