Mocha.js: Desktop Notification Cheat Sheet

Node-based notifications

Enable Mocha’s desktop notifications:

$ mocha --growl

Browser-based notifications

Enable Mocha’s web notifications with a slight modification to your client-side mocha HTML. Add a call to mocha.growl() prior to running your tests:

<!DOCTYPE html>
<html lang="en">
    <meta charset="utf-8" />
    <title>Mocha Tests</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="stylesheet" href="" />
    <div id="mocha"></div>

    <script src=""></script>
    <script src=""></script>

    <script class="mocha-init">
      mocha.growl(); // <-- Enables web notifications
    <script src="test.spec.js"></script>
    <script class="mocha-exec">;

Leave a Reply

Your email address will not be published.