title: How to accept permission for getUserMedia() in jasmine testing?
body: <p>I'm writing an AudioRecorder class whose init() accesses Navigator.mediaDevices.getUserMedia({audio: true}). </p>
  
  <p>Is there a way to accept the user permission request in the DOM from Jasmine?</p>
  
  <p>Source:</p>
  
  <pre><code>export default class AudioRecorder {
    async init() {
      const audioStream = await navigator.mediaDevices.getUserMedia({ audio: true });
      this.recorder = new MediaRecorder(audioStream)
    }
  </code></pre>
  
  <p>Jasmine test:</p>
  
  <pre><code>it('init()', done =&gt; {
      const record = new AudioRecorder();
  
      record.init().then(() =&gt; {
        done();
      });
    });
  </code></pre>