Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve console feedback and add sound effects to --watch mode #5

Merged
merged 2 commits into from
Feb 20, 2024

Conversation

mattbrictson
Copy link
Owner

This commit makes the following improvements to mt --watch:

  • The console is cleared just before running tests. This makes it easier to notice when a change has been detected and tests are starting. It also makes the output from the latest test run easy to distinguish, since it is no longer mixed in with previous runs.
  • On macOS, two different sounds are played at the conclusion of the test run, depending on whether the tests passed or failed. This makes it easy to tell the result of a test while doing TDD without having to even glance at the console.

The clear screen and sound playback functions have been extracted into a Console class. They are only enabled when running mt with a TTY. Sound playback is only enabled on macOS.

This commit makes the following improvements to `mt --watch`:

- The console is cleared just before running tests. This makes it easier
  to notice when a change has been detected and tests are starting. It
  also makes the output from the latest test run easy to distinguish,
  since it is no longer mixed in with previous runs.
- On macOS, two different sounds are played at the conclusion of the
  test run, depending on whether the tests passed or failed. This makes
  it easy to tell the result of a test while doing TDD without having to
  even glance at the console.

The clear screen and sound playback functions have been extracted into a
`Console` class. They are only enabled when running `mt` with a TTY.
Sound playback is only enabled on macOS.
@mattbrictson mattbrictson added ✨ Feature Adds a new feature automerge Automatically merge PR once all required checks pass labels Feb 20, 2024
@kodiakhq kodiakhq bot merged commit 5d80649 into main Feb 20, 2024
6 checks passed
@kodiakhq kodiakhq bot deleted the sound-and-clear branch February 20, 2024 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Automatically merge PR once all required checks pass ✨ Feature Adds a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant