Last active
May 20, 2023 20:45
-
-
Save Rochdy/c2f850a0be21c65806e669f7ceaaff8a to your computer and use it in GitHub Desktop.
Alert upon tests output
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| #Change the test command as your app usage | |
| output="$(npm test)" | |
| cat <<< "${output}" | |
| # Instead of failing you can place a word that appears if tests failed | |
| if grep failing <<< "${output}" > /dev/null; then | |
| #Im using sox/play, you can use vlc or any audio player.. | |
| play https://www.roshdy.dev/assets/f-test.mp3 | |
| # Instead of passing you can place a word that appears if tests passed | |
| elif grep passing <<< "${output}" > /dev/null; then | |
| play https://www.roshdy.dev/assets/s-test.mp3 | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment