|
15 | 15 | */ |
16 | 16 |
|
17 | 17 | import doPlan from "../plan" |
18 | | -import Input, { Tree } from "../Input" |
19 | | -import { importd } from "./1.spec" |
| 18 | +import Input from "../Input" |
20 | 19 |
|
21 | | -const filename = "guidebook-tree-model6.md" |
22 | | - |
23 | | -const messageForMacOS = "echo MMM" |
24 | | -const messageForLinux = "echo LLL" |
25 | | -const messageForWindows = "echo WWW" |
26 | | - |
27 | | -const messageForElectron = |
28 | | - process.platform === "linux" ? messageForLinux : process.platform === "darwin" ? messageForMacOS : messageForWindows |
| 20 | +import importg from "./importg" |
| 21 | +import importd from "./importd" |
29 | 22 |
|
30 | | -// here, we will squash away the choice |
31 | | -const importgForElectron: (name: string) => Tree = (name: string) => ({ |
32 | | - name, |
33 | | - children: [{ name: messageForElectron }], |
34 | | -}) |
35 | | - |
36 | | -// here, we won't squash away the choice |
37 | | -const importgForBrowser: (name: string) => Tree = (name: string) => ({ |
38 | | - name, |
39 | | - children: [ |
40 | | - { name: "Option 1: MacOS", children: [{ name: messageForMacOS }] }, |
41 | | - { name: "Option 2: Linux", children: [{ name: messageForLinux }] }, |
42 | | - { name: "Option 3: Windows", children: [{ name: messageForWindows }] }, |
43 | | - ], |
44 | | -}) |
45 | | - |
46 | | -export const importg: (name?: string) => Tree = (name = "importg") => |
47 | | - (process.env.MOCHA_RUN_TARGET || "electron") === "electron" ? importgForElectron(name) : importgForBrowser(name) |
| 23 | +const filename = "guidebook-tree-model6.md" |
48 | 24 |
|
49 | 25 | const tree: Input["tree"] = () => [ |
50 | 26 | { |
|
0 commit comments