31
32
describe('[When] shell is zsh', () => {
33
layer(TestLive())(it => {
34
- it.scoped('[Then] creates .zshrc with PATH and completions', () =>
34
+ it.scoped('[Then] creates .zshrc with PATH only', () =>
35
Effect.gen(function* () {
36
const os = yield* NodeOs;
37
process.env.SHELL = '/bin/zsh';
46
expect(contents).toContain('# Composio CLI');
47
expect(contents).toContain('export COMPOSIO_INSTALL_DIR=');
48
expect(contents).toContain('export PATH="$COMPOSIO_INSTALL_DIR:$PATH"');
49
- expect(contents).toContain('# Composio CLI completions');
49
+ expect(contents).not.toContain('# Composio CLI completions');
50
51
const lines = yield* MockConsole.getLines();
52
const output = lines.join('\n');
53
expect(output).toContain('Detected shell: zsh');
54
expect(output).toContain('PATH: will add');
55
- expect(output).toContain('Completions: will install shell completions');
55
+ expect(output).toContain('Completions: skipped for zsh');
56
expect(output).toContain('Updated');
57
+ expect(output).toContain('source ~/.zshrc');
58
})
59
);
60
});
154
expect(pathMarkerCount).toBe(1);
155
156
const completionsCount = contents.match(/^# Composio CLI completions$/gm)?.length ?? 0;
156
- expect(completionsCount).toBe(1);
157
+ expect(completionsCount).toBe(0);
158
})
159
);
160
});
181
const lines = yield* MockConsole.getLines();
182
const output = lines.join('\n');
183
expect(output).toContain('PATH: already configured');
183
- expect(output).toContain('Completions: already configured');
184
+ expect(output).toContain('Completions: skipped for zsh');
185
expect(output).toContain('Shell integration already configured');
186
187
// File should not have grown
188
const contents = yield* fs.readFileString(rcPath);
189
const markerCount = contents.split('# Composio CLI').length - 1;
189
- // "# Composio CLI" appears in both the PATH block marker and the completions marker
190
expect(markerCount).toBe(2);
191
})
192
);