magus-cli 7.11.8 → 7.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -4
- package/src/__tests__/alias-agent-teams.test.ts +281 -0
- package/src/__tests__/alias-autocompact.test.ts +169 -0
- package/src/__tests__/alias-env-adoption.test.ts +475 -0
- package/src/__tests__/alias-option-compatibility.test.ts +92 -0
- package/src/data/alias-flags.ts +114 -1
- package/src/services/alias-shell-writer.ts +129 -21
- package/src/ui/components/modals/InputModal.tsx +5 -0
- package/src/ui/screens/AliasScreen.tsx +31 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "magus-cli",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.12.1",
|
|
4
4
|
"description": "TUI tool for managing Claude Code plugins, MCPs, and configuration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/main.tsx",
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
"typescript": "^5.6.3"
|
|
66
66
|
},
|
|
67
67
|
"optionalDependencies": {
|
|
68
|
-
"magus-cli-darwin-arm64": "7.
|
|
69
|
-
"magus-cli-darwin-x64": "7.
|
|
70
|
-
"magus-cli-linux-x64": "7.
|
|
68
|
+
"magus-cli-darwin-arm64": "7.12.1",
|
|
69
|
+
"magus-cli-darwin-x64": "7.12.1",
|
|
70
|
+
"magus-cli-linux-x64": "7.12.1"
|
|
71
71
|
}
|
|
72
72
|
}
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
import { describe, expect, it } from "bun:test";
|
|
2
|
+
import { ALIAS_FLAGS, FLAG_GROUPS, getFlagById } from "../data/alias-flags";
|
|
3
|
+
import {
|
|
4
|
+
type ShellKind,
|
|
5
|
+
parseAliasFromRc,
|
|
6
|
+
renderAlias,
|
|
7
|
+
renderArgs,
|
|
8
|
+
renderArgsAsTokens,
|
|
9
|
+
renderEnv,
|
|
10
|
+
} from "../services/alias-shell-writer";
|
|
11
|
+
import { type AliasConfig, defaultValueFor } from "../services/alias-store";
|
|
12
|
+
|
|
13
|
+
const assignment = "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1";
|
|
14
|
+
const shells: ShellKind[] = ["bash", "zsh", "fish"];
|
|
15
|
+
const modes = ["tmux", "iterm2", "in-process", "auto"];
|
|
16
|
+
|
|
17
|
+
function expectAliasLine(
|
|
18
|
+
block: string,
|
|
19
|
+
shell: ShellKind,
|
|
20
|
+
envEnabled: boolean,
|
|
21
|
+
argv: string[],
|
|
22
|
+
aliasName = "c",
|
|
23
|
+
) {
|
|
24
|
+
const lines = block.split("\n").filter((line) => line.startsWith("alias "));
|
|
25
|
+
const prefix = envEnabled
|
|
26
|
+
? `${(shell === "fish" ? "env " : "") + assignment} claude`
|
|
27
|
+
: "claude";
|
|
28
|
+
const bareArgs = argv.length === 0 ? "" : ` ${argv.join(" ")}`;
|
|
29
|
+
|
|
30
|
+
expect(lines).toHaveLength(1);
|
|
31
|
+
if (shell === "fish") {
|
|
32
|
+
const quotedArgs =
|
|
33
|
+
argv.length === 0 ? "" : ` ${argv.map((arg) => `'${arg}'`).join(" ")}`;
|
|
34
|
+
expect(lines).toEqual([`alias ${aliasName} '${prefix}${quotedArgs}'`]);
|
|
35
|
+
} else {
|
|
36
|
+
expect(lines).toEqual([`alias ${aliasName}='${prefix}${bareArgs}'`]);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
describe("agent teams catalog", () => {
|
|
41
|
+
it("TEST-7 REQ-1 REQ-4 exposes one env-backed select and the Agent teams group", () => {
|
|
42
|
+
expect(getFlagById("agent-teams")).toMatchObject({
|
|
43
|
+
id: "agent-teams",
|
|
44
|
+
label: "Agent teams",
|
|
45
|
+
kind: "select",
|
|
46
|
+
env: assignment,
|
|
47
|
+
flag: "--teammate-mode",
|
|
48
|
+
group: "agents",
|
|
49
|
+
});
|
|
50
|
+
expect(FLAG_GROUPS.filter((group) => group.id === "agents")).toEqual([
|
|
51
|
+
{ id: "agents", label: "Agent teams" },
|
|
52
|
+
]);
|
|
53
|
+
expect(
|
|
54
|
+
ALIAS_FLAGS.filter((flag) => flag.id === "agent-teams"),
|
|
55
|
+
).toHaveLength(1);
|
|
56
|
+
expect(
|
|
57
|
+
ALIAS_FLAGS.filter(
|
|
58
|
+
(flag) => flag.kind === "boolean" && flag.env !== undefined,
|
|
59
|
+
),
|
|
60
|
+
).toEqual([]);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it("TEST-8 REQ-4 exposes the ordered teammate choices without a dependency", () => {
|
|
64
|
+
const flag = getFlagById("agent-teams");
|
|
65
|
+
|
|
66
|
+
expect(flag.options?.map((option) => option.value)).toEqual([
|
|
67
|
+
"tmux",
|
|
68
|
+
"iterm2",
|
|
69
|
+
"in-process",
|
|
70
|
+
"auto",
|
|
71
|
+
]);
|
|
72
|
+
expect(flag.requires).toBeUndefined();
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
it("TEST-22 REQ-1 REQ-4 has no separate teammate-mode catalog entry", () => {
|
|
76
|
+
expect(ALIAS_FLAGS.filter((flag) => flag.id === "teammate-mode")).toEqual(
|
|
77
|
+
[],
|
|
78
|
+
);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
it("TEST-23 REQ-1 REQ-4 defaults agent teams to a disabled tmux select", () => {
|
|
82
|
+
const flag = getFlagById("agent-teams");
|
|
83
|
+
|
|
84
|
+
expect(defaultValueFor(flag)).toEqual({
|
|
85
|
+
kind: "select",
|
|
86
|
+
enabled: false,
|
|
87
|
+
value: "tmux",
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
describe("environment and argv separation", () => {
|
|
93
|
+
for (const state of ["enabled", "disabled", "missing"] as const) {
|
|
94
|
+
it(`TEST-9 REQ-1 REQ-6 REQ-7 REQ-9 separates env from argv when agent teams is ${state}`, () => {
|
|
95
|
+
const config: AliasConfig = { aliasName: "c", flags: {} };
|
|
96
|
+
if (state !== "missing") {
|
|
97
|
+
config.flags["agent-teams"] = {
|
|
98
|
+
kind: "select",
|
|
99
|
+
enabled: state === "enabled",
|
|
100
|
+
value: "tmux",
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
const expectedEnv = state === "enabled" ? [assignment] : [];
|
|
104
|
+
const expectedArgv =
|
|
105
|
+
state === "enabled" ? ["--teammate-mode", "tmux"] : [];
|
|
106
|
+
|
|
107
|
+
expect(renderEnv(config)).toEqual(expectedEnv);
|
|
108
|
+
expect(renderArgs(config)).toEqual(
|
|
109
|
+
expectedArgv.map((text) => ({ kind: "literal", text })),
|
|
110
|
+
);
|
|
111
|
+
expect(renderArgsAsTokens(config)).toEqual([
|
|
112
|
+
...expectedEnv,
|
|
113
|
+
...expectedArgv,
|
|
114
|
+
]);
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
describe("agent teams shell output and POSIX round-trips", () => {
|
|
120
|
+
// Fish rendering is covered; the parse-back contract uses POSIX alias lines.
|
|
121
|
+
for (const shell of shells) {
|
|
122
|
+
it(`TEST-10 REQ-8 REQ-13 renders automatic agent teams with env before claude on ${shell}`, () => {
|
|
123
|
+
const config: AliasConfig = {
|
|
124
|
+
aliasName: "c",
|
|
125
|
+
flags: {
|
|
126
|
+
"agent-teams": { kind: "select", enabled: true, value: "auto" },
|
|
127
|
+
},
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
const rendered = renderAlias(config, shell);
|
|
131
|
+
|
|
132
|
+
expect(rendered.shell).toBe(shell);
|
|
133
|
+
expectAliasLine(rendered.block, shell, true, ["--teammate-mode", "auto"]);
|
|
134
|
+
if (shell !== "fish") {
|
|
135
|
+
expect(parseAliasFromRc(rendered.block)).toEqual({
|
|
136
|
+
aliasName: "c",
|
|
137
|
+
flags: {
|
|
138
|
+
"agent-teams": { kind: "select", enabled: true, value: "auto" },
|
|
139
|
+
},
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
for (const mode of modes) {
|
|
145
|
+
it(`TEST-11 REQ-4 REQ-6 REQ-7 REQ-8 REQ-9 REQ-13 ${shell === "fish" ? "renders " : "renders and round-trips "}${mode} teammates on ${shell}`, () => {
|
|
146
|
+
const config: AliasConfig = {
|
|
147
|
+
aliasName: "c",
|
|
148
|
+
flags: {
|
|
149
|
+
"agent-teams": { kind: "select", enabled: true, value: mode },
|
|
150
|
+
},
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
const rendered = renderAlias(config, shell);
|
|
154
|
+
|
|
155
|
+
expect(renderEnv(config)).toEqual([assignment]);
|
|
156
|
+
expect(renderArgs(config)).toEqual([
|
|
157
|
+
{ kind: "literal", text: "--teammate-mode" },
|
|
158
|
+
{ kind: "literal", text: mode },
|
|
159
|
+
]);
|
|
160
|
+
expect(renderArgsAsTokens(config)).toEqual([
|
|
161
|
+
assignment,
|
|
162
|
+
"--teammate-mode",
|
|
163
|
+
mode,
|
|
164
|
+
]);
|
|
165
|
+
expectAliasLine(rendered.block, shell, true, ["--teammate-mode", mode]);
|
|
166
|
+
if (shell !== "fish") {
|
|
167
|
+
expect(parseAliasFromRc(rendered.block)).toEqual({
|
|
168
|
+
aliasName: "c",
|
|
169
|
+
flags: {
|
|
170
|
+
"agent-teams": { kind: "select", enabled: true, value: mode },
|
|
171
|
+
},
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
for (const state of ["missing", "disabled"] as const) {
|
|
178
|
+
it(`TEST-12 REQ-14 omits both team outputs with ${state} agent teams but keeps context size on ${shell}`, () => {
|
|
179
|
+
const config: AliasConfig = {
|
|
180
|
+
aliasName: "c",
|
|
181
|
+
flags: {
|
|
182
|
+
autocompact: { kind: "text", enabled: true, value: "200k" },
|
|
183
|
+
},
|
|
184
|
+
};
|
|
185
|
+
const withoutTeams = structuredClone(config);
|
|
186
|
+
if (state === "disabled") {
|
|
187
|
+
config.flags["agent-teams"] = {
|
|
188
|
+
kind: "select",
|
|
189
|
+
enabled: false,
|
|
190
|
+
value: "tmux",
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
const original = structuredClone(config);
|
|
194
|
+
|
|
195
|
+
const rendered = renderAlias(config, shell);
|
|
196
|
+
|
|
197
|
+
expect(rendered).toEqual(renderAlias(withoutTeams, shell));
|
|
198
|
+
expect(renderEnv(config)).toEqual([]);
|
|
199
|
+
expect(renderArgs(config)).toEqual([
|
|
200
|
+
{ kind: "literal", text: "--autocompact" },
|
|
201
|
+
{ kind: "literal", text: "200k" },
|
|
202
|
+
]);
|
|
203
|
+
expect(renderArgsAsTokens(config)).toEqual(["--autocompact", "200k"]);
|
|
204
|
+
expectAliasLine(rendered.block, shell, false, [
|
|
205
|
+
"--autocompact",
|
|
206
|
+
"200k",
|
|
207
|
+
]);
|
|
208
|
+
if (shell !== "fish") {
|
|
209
|
+
expect(parseAliasFromRc(rendered.block)).toEqual({
|
|
210
|
+
aliasName: "c",
|
|
211
|
+
flags: {
|
|
212
|
+
autocompact: { kind: "text", enabled: true, value: "200k" },
|
|
213
|
+
},
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
expect(config).toEqual(original);
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
it(`TEST-13 REQ-4 REQ-7 REQ-8 REQ-13 omits both outputs for disabled agent teams on ${shell}`, () => {
|
|
221
|
+
const config: AliasConfig = {
|
|
222
|
+
aliasName: "c",
|
|
223
|
+
flags: {
|
|
224
|
+
"agent-teams": { kind: "select", enabled: false, value: "tmux" },
|
|
225
|
+
},
|
|
226
|
+
};
|
|
227
|
+
const withoutTeams: AliasConfig = { aliasName: "c", flags: {} };
|
|
228
|
+
|
|
229
|
+
const rendered = renderAlias(config, shell);
|
|
230
|
+
|
|
231
|
+
expect(rendered).toEqual(renderAlias(withoutTeams, shell));
|
|
232
|
+
expect(renderEnv(config)).toEqual([]);
|
|
233
|
+
expect(renderArgs(config)).toEqual([]);
|
|
234
|
+
expect(renderArgsAsTokens(config)).toEqual([]);
|
|
235
|
+
expectAliasLine(rendered.block, shell, false, []);
|
|
236
|
+
if (shell !== "fish") {
|
|
237
|
+
expect(parseAliasFromRc(rendered.block)).toEqual({
|
|
238
|
+
aliasName: "c",
|
|
239
|
+
flags: {},
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
it(`TEST-14 REQ-6 REQ-7 REQ-8 REQ-9 REQ-13 renders agent teams after context size with env first on ${shell}`, () => {
|
|
245
|
+
const config: AliasConfig = {
|
|
246
|
+
aliasName: "crew",
|
|
247
|
+
flags: {
|
|
248
|
+
"agent-teams": { kind: "select", enabled: true, value: "tmux" },
|
|
249
|
+
autocompact: { kind: "text", enabled: true, value: "200k" },
|
|
250
|
+
},
|
|
251
|
+
};
|
|
252
|
+
const contextIndex = ALIAS_FLAGS.findIndex(
|
|
253
|
+
(flag) => flag.id === "autocompact",
|
|
254
|
+
);
|
|
255
|
+
const teamsIndex = ALIAS_FLAGS.findIndex(
|
|
256
|
+
(flag) => flag.id === "agent-teams",
|
|
257
|
+
);
|
|
258
|
+
expect(contextIndex).toBeGreaterThanOrEqual(0);
|
|
259
|
+
expect(teamsIndex).toBeGreaterThan(contextIndex);
|
|
260
|
+
const argv = ["--autocompact", "200k", "--teammate-mode", "tmux"];
|
|
261
|
+
|
|
262
|
+
const rendered = renderAlias(config, shell);
|
|
263
|
+
|
|
264
|
+
expect(renderEnv(config)).toEqual([assignment]);
|
|
265
|
+
expect(renderArgs(config)).toEqual(
|
|
266
|
+
argv.map((text) => ({ kind: "literal", text })),
|
|
267
|
+
);
|
|
268
|
+
expect(renderArgsAsTokens(config)).toEqual([assignment, ...argv]);
|
|
269
|
+
expectAliasLine(rendered.block, shell, true, argv, "crew");
|
|
270
|
+
if (shell !== "fish") {
|
|
271
|
+
expect(parseAliasFromRc(rendered.block)).toEqual({
|
|
272
|
+
aliasName: "crew",
|
|
273
|
+
flags: {
|
|
274
|
+
"agent-teams": { kind: "select", enabled: true, value: "tmux" },
|
|
275
|
+
autocompact: { kind: "text", enabled: true, value: "200k" },
|
|
276
|
+
},
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
});
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { describe, expect, it } from "bun:test";
|
|
2
|
+
import {
|
|
3
|
+
AUTOCOMPACT_MAX_TOKENS,
|
|
4
|
+
AUTOCOMPACT_MIN_TOKENS,
|
|
5
|
+
getFlagById,
|
|
6
|
+
parseAutocompactSize,
|
|
7
|
+
validateAutocompactSize,
|
|
8
|
+
} from "../data/alias-flags";
|
|
9
|
+
import {
|
|
10
|
+
type ShellKind,
|
|
11
|
+
parseAliasFromRc,
|
|
12
|
+
renderAlias,
|
|
13
|
+
renderArgs,
|
|
14
|
+
renderArgsAsTokens,
|
|
15
|
+
renderEnv,
|
|
16
|
+
} from "../services/alias-shell-writer";
|
|
17
|
+
import type { AliasConfig } from "../services/alias-store";
|
|
18
|
+
|
|
19
|
+
const shells: ShellKind[] = ["bash", "zsh", "fish"];
|
|
20
|
+
|
|
21
|
+
function expectSizeAlias(block: string, shell: ShellKind, value?: string) {
|
|
22
|
+
const lines = block.split("\n").filter((line) => line.startsWith("alias "));
|
|
23
|
+
const args = value === undefined ? "" : ` --autocompact ${value}`;
|
|
24
|
+
|
|
25
|
+
expect(lines).toHaveLength(1);
|
|
26
|
+
if (shell === "fish") {
|
|
27
|
+
const quotedArgs = value === undefined ? "" : ` '--autocompact' '${value}'`;
|
|
28
|
+
expect([
|
|
29
|
+
`alias c 'claude${args}'`,
|
|
30
|
+
`alias c 'claude${quotedArgs}'`,
|
|
31
|
+
]).toContain(lines[0]);
|
|
32
|
+
} else {
|
|
33
|
+
expect(lines).toEqual([`alias c='claude${args}'`]);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
describe("context window size catalog and validation", () => {
|
|
38
|
+
it("TEST-1 REQ-2 exposes the context text option and its validator", () => {
|
|
39
|
+
const flag = getFlagById("autocompact");
|
|
40
|
+
|
|
41
|
+
expect(flag).toMatchObject({
|
|
42
|
+
id: "autocompact",
|
|
43
|
+
label: "Context window size",
|
|
44
|
+
kind: "text",
|
|
45
|
+
flag: "--autocompact",
|
|
46
|
+
group: "context",
|
|
47
|
+
});
|
|
48
|
+
expect(typeof flag.validateValue).toBe("function");
|
|
49
|
+
expect(flag.env).toBeUndefined();
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
const validSizes: Array<[string, number | "auto"]> = [
|
|
53
|
+
["auto", "auto"],
|
|
54
|
+
["AUTO", "auto"],
|
|
55
|
+
["aUtO", "auto"],
|
|
56
|
+
["200k", 200000],
|
|
57
|
+
["1m", 1000000],
|
|
58
|
+
["200000", 200000],
|
|
59
|
+
["500", 500000],
|
|
60
|
+
["100k", 100000],
|
|
61
|
+
["100000", 100000],
|
|
62
|
+
["100", 100000],
|
|
63
|
+
["1000k", 1000000],
|
|
64
|
+
["1000000", 1000000],
|
|
65
|
+
["1000", 1000000],
|
|
66
|
+
];
|
|
67
|
+
|
|
68
|
+
for (const [value, expected] of validSizes) {
|
|
69
|
+
it(`TEST-2 REQ-3 accepts ${JSON.stringify(value)} as ${expected}`, () => {
|
|
70
|
+
const catalogValidator = getFlagById("autocompact").validateValue;
|
|
71
|
+
|
|
72
|
+
expect(parseAutocompactSize(value)).toBe(expected);
|
|
73
|
+
expect(validateAutocompactSize(value)).toBeNull();
|
|
74
|
+
expect(catalogValidator?.(value)).toBeNull();
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const invalidSizes = [
|
|
79
|
+
"50k",
|
|
80
|
+
"2m",
|
|
81
|
+
"abc",
|
|
82
|
+
"",
|
|
83
|
+
"0",
|
|
84
|
+
"99",
|
|
85
|
+
"1001",
|
|
86
|
+
"99k",
|
|
87
|
+
"1001k",
|
|
88
|
+
"99999",
|
|
89
|
+
"1000001",
|
|
90
|
+
];
|
|
91
|
+
|
|
92
|
+
for (const value of invalidSizes) {
|
|
93
|
+
it(`TEST-3 REQ-3 rejects ${JSON.stringify(value)} with a reason`, () => {
|
|
94
|
+
const catalogValidator = getFlagById("autocompact").validateValue;
|
|
95
|
+
|
|
96
|
+
expect(parseAutocompactSize(value)).toBeUndefined();
|
|
97
|
+
const reasons = [
|
|
98
|
+
validateAutocompactSize(value),
|
|
99
|
+
catalogValidator?.(value),
|
|
100
|
+
];
|
|
101
|
+
for (const reason of reasons) {
|
|
102
|
+
expect(reason).toEqual(expect.any(String));
|
|
103
|
+
expect(reason).toMatch(/\S/);
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
it("TEST-4 REQ-3 exposes the inclusive 100000–1000000 token limits", () => {
|
|
109
|
+
expect(AUTOCOMPACT_MIN_TOKENS).toBe(100000);
|
|
110
|
+
expect(AUTOCOMPACT_MAX_TOKENS).toBe(1000000);
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
describe("context window size shell output", () => {
|
|
115
|
+
// Fish rendering is covered; the parse-back contract uses POSIX alias lines.
|
|
116
|
+
for (const shell of shells) {
|
|
117
|
+
for (const value of ["auto", "200k", "1m", "200000", "500"]) {
|
|
118
|
+
it(`TEST-5 REQ-2 REQ-7 REQ-8 REQ-13 ${shell === "fish" ? "renders " : "renders and round-trips "}${value} on ${shell}`, () => {
|
|
119
|
+
const config: AliasConfig = {
|
|
120
|
+
aliasName: "c",
|
|
121
|
+
flags: {
|
|
122
|
+
autocompact: { kind: "text", enabled: true, value },
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
const rendered = renderAlias(config, shell);
|
|
127
|
+
|
|
128
|
+
expect(rendered.shell).toBe(shell);
|
|
129
|
+
expect(renderEnv(config)).toEqual([]);
|
|
130
|
+
expect(renderArgs(config)).toEqual([
|
|
131
|
+
{ kind: "literal", text: "--autocompact" },
|
|
132
|
+
{ kind: "literal", text: value },
|
|
133
|
+
]);
|
|
134
|
+
expect(renderArgsAsTokens(config)).toEqual(["--autocompact", value]);
|
|
135
|
+
expectSizeAlias(rendered.block, shell, value);
|
|
136
|
+
if (shell !== "fish") {
|
|
137
|
+
expect(parseAliasFromRc(rendered.block)).toEqual({
|
|
138
|
+
aliasName: "c",
|
|
139
|
+
flags: {
|
|
140
|
+
autocompact: { kind: "text", enabled: true, value },
|
|
141
|
+
},
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
it(`TEST-6 REQ-2 REQ-10 omits a disabled context size on ${shell}`, () => {
|
|
148
|
+
const config: AliasConfig = {
|
|
149
|
+
aliasName: "c",
|
|
150
|
+
flags: {
|
|
151
|
+
autocompact: { kind: "text", enabled: false, value: "200k" },
|
|
152
|
+
},
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
const rendered = renderAlias(config, shell);
|
|
156
|
+
|
|
157
|
+
expect(renderArgs(config)).toEqual([]);
|
|
158
|
+
expect(renderArgsAsTokens(config)).toEqual([]);
|
|
159
|
+
expect(renderEnv(config)).toEqual([]);
|
|
160
|
+
expectSizeAlias(rendered.block, shell);
|
|
161
|
+
if (shell !== "fish") {
|
|
162
|
+
expect(parseAliasFromRc(rendered.block)).toEqual({
|
|
163
|
+
aliasName: "c",
|
|
164
|
+
flags: {},
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
});
|