summaryrefslogtreecommitdiff
path: root/packages/core/src/tools/shell.test.ts
diff options
context:
space:
mode:
authorTommaso Sciortino <[email protected]>2025-08-15 13:31:00 -0700
committerGitHub <[email protected]>2025-08-15 20:31:00 +0000
commitb55f19fdfc36d272f6a96f08621d2e3ec8091e4e (patch)
tree9d7853f94823afdd23c5e8e26219cba711c56eae /packages/core/src/tools/shell.test.ts
parent31b4c76a6b0e52c9d748f51a1766bec19552adf5 (diff)
use toMatchSnapshot in test (#6344)
Diffstat (limited to 'packages/core/src/tools/shell.test.ts')
-rw-r--r--packages/core/src/tools/shell.test.ts30
1 files changed, 2 insertions, 28 deletions
diff --git a/packages/core/src/tools/shell.test.ts b/packages/core/src/tools/shell.test.ts
index 1f469ede..c0b409fa 100644
--- a/packages/core/src/tools/shell.test.ts
+++ b/packages/core/src/tools/shell.test.ts
@@ -396,39 +396,13 @@ describe('ShellTool', () => {
it('should return the windows description when on windows', () => {
vi.mocked(os.platform).mockReturnValue('win32');
const shellTool = new ShellTool(mockConfig);
- expect(shellTool.description)
- .toEqual(`This tool executes a given shell command as \`cmd.exe /c <command>\`. Command can start background processes using \`start /b\`.
-
- The following information is returned:
-
- Command: Executed command.
- Directory: Directory (relative to project root) where command was executed, or \`(root)\`.
- Stdout: Output on stdout stream. Can be \`(empty)\` or partial on error and for any unwaited background processes.
- Stderr: Output on stderr stream. Can be \`(empty)\` or partial on error and for any unwaited background processes.
- Error: Error or \`(none)\` if no error was reported for the subprocess.
- Exit Code: Exit code or \`(none)\` if terminated by signal.
- Signal: Signal number or \`(none)\` if no signal was received.
- Background PIDs: List of background processes started or \`(none)\`.
- Process Group PGID: Process group started or \`(none)\``);
+ expect(shellTool.description).toMatchSnapshot();
});
it('should return the non-windows description when not on windows', () => {
vi.mocked(os.platform).mockReturnValue('linux');
const shellTool = new ShellTool(mockConfig);
- expect(shellTool.description)
- .toEqual(`This tool executes a given shell command as \`bash -c <command>\`. Command can start background processes using \`&\`. Command is executed as a subprocess that leads its own process group. Command process group can be terminated as \`kill -- -PGID\` or signaled as \`kill -s SIGNAL -- -PGID\`.
-
- The following information is returned:
-
- Command: Executed command.
- Directory: Directory (relative to project root) where command was executed, or \`(root)\`.
- Stdout: Output on stdout stream. Can be \`(empty)\` or partial on error and for any unwaited background processes.
- Stderr: Output on stderr stream. Can be \`(empty)\` or partial on error and for any unwaited background processes.
- Error: Error or \`(none)\` if no error was reported for the subprocess.
- Exit Code: Exit code or \`(none)\` if terminated by signal.
- Signal: Signal number or \`(none)\` if no signal was received.
- Background PIDs: List of background processes started or \`(none)\`.
- Process Group PGID: Process group started or \`(none)\``);
+ expect(shellTool.description).toMatchSnapshot();
});
});
});