|
1 | 1 | import { it, expect, describe } from "vitest"; |
2 | 2 | import { type WorkspaceConfiguration } from "vscode"; |
3 | 3 |
|
4 | | -import { |
5 | | - getGlobalFlags, |
6 | | - getSshFlags, |
7 | | - shouldDisableAutostart, |
8 | | -} from "@/cliConfig"; |
| 4 | +import { getGlobalFlags, getSshFlags } from "@/cliConfig"; |
9 | 5 |
|
10 | 6 | import { isWindows } from "../utils/platform"; |
11 | 7 |
|
@@ -86,48 +82,6 @@ describe("cliConfig", () => { |
86 | 82 | }); |
87 | 83 | }); |
88 | 84 |
|
89 | | - describe("shouldDisableAutostart", () => { |
90 | | - const mockConfig = (setting: string) => |
91 | | - ({ |
92 | | - get: (key: string) => |
93 | | - key === "coder.disableAutostart" ? setting : undefined, |
94 | | - }) as unknown as WorkspaceConfiguration; |
95 | | - |
96 | | - it("returns true when setting is 'always' regardless of platform", () => { |
97 | | - const config = mockConfig("always"); |
98 | | - expect(shouldDisableAutostart(config, "darwin")).toBe(true); |
99 | | - expect(shouldDisableAutostart(config, "linux")).toBe(true); |
100 | | - expect(shouldDisableAutostart(config, "win32")).toBe(true); |
101 | | - }); |
102 | | - |
103 | | - it("returns false when setting is 'never' regardless of platform", () => { |
104 | | - const config = mockConfig("never"); |
105 | | - expect(shouldDisableAutostart(config, "darwin")).toBe(false); |
106 | | - expect(shouldDisableAutostart(config, "linux")).toBe(false); |
107 | | - expect(shouldDisableAutostart(config, "win32")).toBe(false); |
108 | | - }); |
109 | | - |
110 | | - it("returns true when setting is 'auto' and platform is darwin", () => { |
111 | | - const config = mockConfig("auto"); |
112 | | - expect(shouldDisableAutostart(config, "darwin")).toBe(true); |
113 | | - }); |
114 | | - |
115 | | - it("returns false when setting is 'auto' and platform is not darwin", () => { |
116 | | - const config = mockConfig("auto"); |
117 | | - expect(shouldDisableAutostart(config, "linux")).toBe(false); |
118 | | - expect(shouldDisableAutostart(config, "win32")).toBe(false); |
119 | | - expect(shouldDisableAutostart(config, "freebsd")).toBe(false); |
120 | | - }); |
121 | | - |
122 | | - it("defaults to 'auto' when setting is not configured", () => { |
123 | | - const config = { |
124 | | - get: (_key: string, defaultValue: unknown) => defaultValue, |
125 | | - } as unknown as WorkspaceConfiguration; |
126 | | - expect(shouldDisableAutostart(config, "darwin")).toBe(true); |
127 | | - expect(shouldDisableAutostart(config, "linux")).toBe(false); |
128 | | - }); |
129 | | - }); |
130 | | - |
131 | 85 | describe("getSshFlags", () => { |
132 | 86 | it("returns empty array when no SSH flags configured", () => { |
133 | 87 | const config = { |
|
0 commit comments