TestCafe doesn't provide the capability to allow microphone access in the browser. Meanwhile, take a look at Chrome's command line arguments related to the microphone access feature. It is possible that they will meet your needs.
To run a browser with specified arguments, use the following syntax:
testcafe "chrome --args" test.js.
--use-fake-device-for-media-stream - Use fake device for Media Stream to replace actual camera and microphone.
--use-file-for-fake-audio-capture - Play a .wav file as the microphone. Note that for WebRTC calls we'll treat the bits as if they came from the microphone, which means you should disable audio processing (lest your audio file will play back distorted). The input file is converted to suit Chrome's audio buses if necessary, so most sane .wav files should work. You can pass either to play the file looping or %noloop to stop after playing the file to completion.