Skip to content

Commit f4ba987

Browse files
committed
putting tests strings in test
1 parent b67ff6d commit f4ba987

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

test/core/scad-bin.test.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,30 @@
11
import { describe, expect, it } from "vitest";
2-
import { SCAD_BINS } from "../../src/core/scad-bin";
2+
import { autoBinPath } from "../../src/core/scad-bin";
33

44
const CASES = {
55
linux: [
6-
["auto", SCAD_BINS.LINUX],
7-
["nightly", SCAD_BINS.LINUX_NIGHTLY],
6+
["auto", "openscad"],
7+
["nightly", "openscad-nightly"],
88
],
99
darwin: [
10-
["auto", SCAD_BINS.MACOS],
11-
["nightly", SCAD_BINS.MACOS_NIGHTLY],
10+
["auto", "/Applications/OpenSCAD.app/Contents/MacOS/OpenSCAD"],
11+
["nightly", "/Applications/OpenSCAD.app/Contents/MacOS/OpenSCAD"],
1212
],
1313
win32: [
14-
["auto", SCAD_BINS.WINDOWS],
15-
["nightly", SCAD_BINS.WINDOWS_NIGHTLY],
14+
["auto", "C:/Program Files/Openscad/openscad.exe"],
15+
["nightly", "C:/Program Files/Openscad/openscad-nightly.exe"],
1616
],
1717
} as Record<NodeJS.Platform, [undefined | "auto" | "nightly", string][]>;
1818

19+
// Derive the platform strings
1920
const PLATFORMS = (Object.keys(CASES) as NodeJS.Platform[]).map((k) => [k]);
2021

22+
// run the tests
2123
describe.for(PLATFORMS)(`on %s platforms`, ([testPlatform]) => {
2224
describe.for(CASES[testPlatform])(
2325
`autoBinPath("%s")`,
2426
([binType, binPath]) => {
2527
it("returns a path", async () => {
26-
const { autoBinPath } = await import("../../src/core/scad-bin");
2728
expect(autoBinPath(testPlatform, binType)).toBe(binPath);
2829
});
2930
},

0 commit comments

Comments
 (0)