Skip to content
| Marketplace
Sign in
Visual Studio Code>Testing>Jest Test Runner with SoundNew to Visual Studio Code? Get it now.
Jest Test Runner with Sound

Jest Test Runner with Sound

cvpathi

|
1 install
| (1) | Free
Plays a custom sound when test tasks fail in VS Code
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Test Failure Sound

Play a sound when VS Code test tasks fail. Built for task-based workflows and monorepos.

Features

  • Detects non-zero exit codes from test tasks
  • Plays a bundled default sound or a custom audio file
  • Commands for running all tests, current-file tests, and watch mode
  • Monorepo-aware current-file testing (Yarn workspaces)
  • Cross-platform audio playback (macOS, Windows, Linux)

Installation

Local development

  1. Install dependencies: npm install
  2. Build: npm run compile
  3. Press F5 to launch an Extension Development Host

Package and install

  1. Install vsce: npm install -g @vscode/vsce
  2. Package: vsce package
  3. Install the .vsix from the VS Code Extensions view (Install from VSIX)

Usage

Use the command palette to run tasks:

  • Test Failure Sound: Run Yarn Tests
  • Test Failure Sound: Run Tests for Current File
  • Test Failure Sound: Toggle Watch Mode
  • Test Failure Sound: Select Sound File

The extension listens to task completion and plays a sound when a test task exits with a non-zero code.

Keyboard shortcuts

  • Run Yarn Tests: Ctrl+Alt+Shift+T (Cmd+Option+Shift+T on macOS)
  • Run Tests for Current File: Ctrl+Alt+Shift+F (Cmd+Option+Shift+F on macOS)
  • Toggle Watch Mode: Ctrl+Alt+Shift+W (Cmd+Option+Shift+W on macOS)
  • Select Sound File: Ctrl+Alt+Shift+S (Cmd+Option+Shift+S on macOS)

Configuration

Setting Type Default Description
testFailureSound.enabled boolean true Enable or disable sound playback
testFailureSound.soundFilePath string "" Absolute path to custom sound file; empty uses bundled fahhh.mp3 (or set via command)
testFailureSound.testCommand string "yarn test" Command to run all tests
testFailureSound.testFileCommand string "npx jest {{file}}" Command to run a single test file; {{file}} is replaced
testFailureSound.volume number 0.5 Volume (0.0 to 1.0). Some players may ignore this

Current-file tests and coverage

When you use the default testFailureSound.testFileCommand, the extension automatically adds --coverage=false to avoid global coverage thresholds failing on single-file runs.

Monorepo support

If a monorepo is detected, the extension searches upward from the test file for the nearest package.json with a name and uses it as the Yarn workspace name. For example:

yarn workspace <workspace-name> test {{file}} --coverage=false

If no workspace name is found, it falls back to yarn test {{file}} --coverage=false from the repo root.

Supported audio formats

  • macOS: mp3, wav, aiff, m4a (via afplay)
  • Windows: wav (via PowerShell Media.SoundPlayer)
  • Linux: wav, mp3 (via paplay, aplay, or ffplay)

Limitations

  • Only task execution is observed. Running tests directly in the terminal is not detectable by VS Code extensions.
  • Task names should include keywords like test, jest, vitest, mocha, or spec to be recognized as test tasks.

Troubleshooting

No sound on failures

  1. Check the Output panel: View -> Output -> Test Failure Sound
  2. Verify the sound file path exists (absolute path)
  3. Test playback directly:
    • macOS: afplay /path/to/sound.wav
    • Linux: paplay /path/to/sound.wav
    • Windows: open the file in a media player

Current-file tests fail to run

  1. Confirm the file is inside a workspace folder
  2. Check the detected command in the Output panel
  3. Set testFailureSound.testFileCommand explicitly if your repo requires a custom test runner

Example settings

{
  "testFailureSound.enabled": true,
  "testFailureSound.soundFilePath": "/Users/you/sounds/fail.wav",
  "testFailureSound.testCommand": "yarn test",
  "testFailureSound.testFileCommand": "yarn test -- --testPathPattern={{file}}",
  "testFailureSound.volume": 0.7
}

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft