Skip to content

Conversation

@Chemaclass
Copy link
Member

@Chemaclass Chemaclass commented Jan 5, 2026

📚 Description

Implements #577 - Aligns the timing display for set_up_before_script and tear_down_after_script hooks to the right, matching the alignment of regular test timings for improved visual consistency.

Before

  Running set_up_before_script... done (2.03s)
  ✓ Passed: test_example                                                  12ms
  Running tear_down_after_script... done (1.05s)

After

● set_up_before_script                                               2.03s
✓ Passed: test_example                                                 12ms
● tear_down_after_script                                             1.05s

The new format:

  • Uses the existing bashunit::str::rpad() function for right-alignment (same as test timings)
  • Replaces verbose "Running...done" text with a clean bullet point () prefix
  • Removes parentheses around timings since alignment makes them visually clear
  • Output appears only on completion (no progressive "Running..." feedback)

🔖 Changes

  • src/console_results.sh:
    • print_hook_running(): Now produces no output (full line printed on completion)
    • print_hook_completed(): Prints complete right-aligned line using rpad() with bullet prefix
  • tests/unit/console_results_test.sh: Added 6 new unit tests for hook output functions
  • tests/acceptance/bashunit_lifecycle_output_test.sh: Updated assertions to match new format
  • CHANGELOG.md: Added entry in Unreleased section
  • docs/test-files.md: Updated hook output examples
  • docs/blog/2025-12-19-release-0-31.md: Updated lifecycle hook example

✅ To-do list

  • I updated the CHANGELOG.md to reflect the new feature or fix
  • I updated the documentation to reflect the changes

Closes #577

@Chemaclass Chemaclass self-assigned this Jan 5, 2026
@Chemaclass Chemaclass added the enhancement New feature or request label Jan 5, 2026
@Chemaclass Chemaclass changed the title feat(console): align hook timings to the right Align all displayed timings to the right Jan 5, 2026
@Chemaclass Chemaclass merged commit e159413 into main Jan 5, 2026
16 checks passed
@Chemaclass Chemaclass deleted the feat/577-align-timing-to-right branch January 5, 2026 15:45
@carlfriedrich
Copy link
Contributor

Great, thanks a lot! 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Align all displayed timings to the right

3 participants