* Set the value returned for `zoo-code.workspace.rootResolution` in tests. * Pass `undefined` to fall back to the default ("activeEditor").
(value: "activeEditor" | "firstFolder" | undefined)
| 36 | * Pass `undefined` to fall back to the default ("activeEditor"). |
| 37 | */ |
| 38 | function setRootResolution(value: "activeEditor" | "firstFolder" | undefined) { |
| 39 | mockWorkspace.getConfiguration = (section?: string) => ({ |
| 40 | get: (key: string, defaultValue?: unknown) => { |
| 41 | if (section === "zoo-code" && key === "workspace.rootResolution") { |
| 42 | return value ?? defaultValue |
| 43 | } |
| 44 | return defaultValue |
| 45 | }, |
| 46 | }) |
| 47 | } |
| 48 | |
| 49 | /** |
| 50 | * Configure the mock workspace folders + active editor for a single test. |