/test
Runs a test command and automatically adds its output to the chat on failure.
/test <command> runs a shell command (typically the test suite). Unlike /run, the output is only added to the chat automatically on a non-zero exit code, so Aider can work directly with the test failures. Without a command, Aider uses the one configured via --test-cmd; --test runs it once at startup and then exits; --auto-test repeats it automatically after every change.
โ WHEN TO USE IT?
Check right after a change whether tests still pass
/test pytest -q โ on failure, the traceback lands in the chat automatically so Aider can fix it
Automate the test run permanently after every Aider change
Set --test-cmd 'npm test' together with --auto-test at startup instead of calling /test manually all the time
โ WHEN NOT TO?
You want to see the output every time, even on a successful run
/test only adds the output to the chat automatically on failure (non-zero exit).
Better: Use /run <test command> and add the output to the chat manually when it's also needed on success
The command isn't a test command but e.g. a build or deploy script
/test is semantically meant for test commands; a non-zero exit from a deploy script can trigger the wrong error interpretation.
Better: Use /run for general shell commands
SOURCES
- Aider Docs โ In-chat Commands โ aider.chat