@@ -69,6 +69,8 @@ bashunit test tests/ --parallel --simple
6969| ` --debug [file] ` | Enable shell debug mode |
7070| ` --no-output ` | Suppress all output |
7171| ` --failures-only ` | Only show failures |
72+ | ` --show-output ` | Show test output on failure (default) |
73+ | ` --no-output-on-failure ` | Hide test output on failure |
7274| ` --strict ` | Enable strict shell mode |
7375| ` --skip-env-file ` | Skip ` .env ` loading, use shell environment only |
7476| ` -l, --login ` | Run tests in login shell context |
@@ -231,6 +233,33 @@ bashunit test tests/ --report-html report.html
231233```
232234:::
233235
236+ ### Show Output on Failure
237+
238+ > ` bashunit test --show-output `
239+ > ` bashunit test --no-output-on-failure `
240+
241+ Control whether test output (stdout/stderr) is displayed when tests fail with runtime errors.
242+
243+ By default (` --show-output ` ), when a test fails due to a runtime error (command not found,
244+ unbound variable, permission denied, etc.), bashunit displays the captured output in an
245+ "Output:" section to help debug the failure.
246+
247+ Use ` --no-output-on-failure ` to suppress this output.
248+
249+ ::: code-group
250+ ``` bash [Example]
251+ bashunit test tests/ --no-output-on-failure
252+ ```
253+ ``` [Output with --show-output (default)]
254+ ✗ Error: My test function
255+ command not found
256+ Output:
257+ Debug: Setting up test
258+ Running command: my_command
259+ /path/to/test.sh: line 5: my_command: command not found
260+ ```
261+ :::
262+
234263### Strict Mode
235264
236265> ` bashunit test --strict `
0 commit comments