Play fahhhhh.mp3 when a terminal-based test command fails in VS Code.
What it does
Watches terminal shell execution events exposed by the stable VS Code API.
Detects common test commands such as npm test, pnpm test, jest, vitest, mocha, playwright test, cypress run, and node --test.
Plays the bundled fahhhhh.mp3 when the command exits with a non-zero code.
Includes a FAAAH: Play Failure Sound command so you can verify the audio works before packaging or publishing.
Important limitation
VS Code's stable extension API currently lets extensions observe terminal shell commands, but it does not provide a global stable event for "any test from any test provider failed". That means this extension can reliably react to terminal-based test runs where shell integration reports the command and exit code, but it cannot universally intercept every failure surfaced by the Testing panel from other extensions.
Sources:
VS Code API: window.onDidEndTerminalShellExecution
VS Code Testing API guide
Settings
faaah.enabled: enable or disable the extension.
faaah.showNotifications: show a notification when a failing test triggers the sound.
faaah.playOnUnknownExitCode: optionally treat an unknown exit code as a failure.
faaah.soundPath: use a custom audio file instead of the bundled fahhhhh.mp3.
faaah.testCommandPatterns: regex patterns used to decide which terminal commands are test runs.
Local development
npm install
code .
Then press F5 in VS Code to launch an Extension Development Host.
Package
npm install
npm run package
That generates a .vsix you can install with Extensions: Install from VSIX.
The packaging script uses a temporary Node 20 runtime because the current vsce tooling requires Node 20+.
Publish to Marketplace
Change publisher in package.json from local-dev to your Marketplace publisher ID.
Create a Visual Studio Marketplace publisher if you do not already have one.
Create a Personal Access Token with Marketplace (Manage) scope.
Run npx -p node@20 -p @vscode/vsce@3.7.1 vsce login <your-publisher>.
Windows: uses Windows Media Player COM automation through PowerShell.
macOS: uses afplay.
Linux: tries ffplay, then mpg123, then mpv.
If your Linux machine has none of those players installed, set up one of them or point faaah.soundPath to a file you can play through your own workflow.