|
1 | 1 | import { describe, expect, it } from "vitest"; |
2 | | -import { SCAD_BINS } from "../../src/core/scad-bin"; |
| 2 | +import { autoBinPath } from "../../src/core/scad-bin"; |
3 | 3 |
|
4 | 4 | const CASES = { |
5 | 5 | linux: [ |
6 | | - ["auto", SCAD_BINS.LINUX], |
7 | | - ["nightly", SCAD_BINS.LINUX_NIGHTLY], |
| 6 | + ["auto", "openscad"], |
| 7 | + ["nightly", "openscad-nightly"], |
8 | 8 | ], |
9 | 9 | 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"], |
12 | 12 | ], |
13 | 13 | 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"], |
16 | 16 | ], |
17 | 17 | } as Record<NodeJS.Platform, [undefined | "auto" | "nightly", string][]>; |
18 | 18 |
|
| 19 | +// Derive the platform strings |
19 | 20 | const PLATFORMS = (Object.keys(CASES) as NodeJS.Platform[]).map((k) => [k]); |
20 | 21 |
|
| 22 | +// run the tests |
21 | 23 | describe.for(PLATFORMS)(`on %s platforms`, ([testPlatform]) => { |
22 | 24 | describe.for(CASES[testPlatform])( |
23 | 25 | `autoBinPath("%s")`, |
24 | 26 | ([binType, binPath]) => { |
25 | 27 | it("returns a path", async () => { |
26 | | - const { autoBinPath } = await import("../../src/core/scad-bin"); |
27 | 28 | expect(autoBinPath(testPlatform, binType)).toBe(binPath); |
28 | 29 | }); |
29 | 30 | }, |
|
0 commit comments