React testing with Enzyme/Mocha - Audio is not defined
<p>I am trying to build a test suite for my react application. A component in the application uses <code>Audio</code>:</p>

<pre><code>const audio = new Audio('beep.wav');
audio.play();
</code></pre>

<p>which works in the browser but according to <a href="https://stackoverflow.com/questions/34757854/referenceerror-audio-is-not-defined">this</a>, is not on node.js. So when I use enzyme to try to render the component it gives an error:</p>

<pre><code>ReferenceError: Audio is not defined
</code></pre>

<p>I am new to testing, but is there a way to get around this? Can I somehow mock an object to take <code>Audio</code>'s place? I am new to font-end/javascript unit testing so I am still trying to learn the tricks.</p>