Jest is failing after upgrading to the Agora SDK NG - release 4.0.1

737 views Asked by At

We have a React application that is using Agora for calling/video calling. We also use the Jest library to run the majority of our testing. After upgrading to the Agora Web SDK NG (release 4.0.1) which is labeled as stable, we are receiving a bunch of Agora errors when trying to use Jest tests (errors pasted below).

It seems that Agora is attempting to check for browser compatibility, but Jest runs without a browser so this is forever going to fail (if thats the problem). Any ideas on how to fix this? Downgrading back to the prior releases isn't an option as we're using the NG features.

Errors when running Jest:

  1. AgoraRTCError NOT_SUPPORT: can not create audio context

  2. console.error node_modules/agora-rtc-sdk-ng/AgoraRTC_N-production.js:375 16:17:09:618 Agora-SDK [ERROR]: your browser is not support web audio

  3. console.error node_modules/agora-rtc-sdk-ng/AgoraRTC_N-production.js:375 16:17:09:619 Agora-SDK [ERROR]: AgoraRTCError NOT_SUPPORT: enumerateDevices() not supported

  4. console.warn node_modules/agora-rtc-sdk-ng/AgoraRTC_N-production.js:375 16:17:09:626 Agora-SDK [WARNING]: Device Detection functionality cannot start properly. AgoraRTCError NOT_SUPPORT: enumerateDevices() not supported

  5. console.error node_modules/agora-rtc-sdk-ng/AgoraRTC_N-production.js:375 16:17:09:626 Agora-SDK [ERROR]: TypeError: Cannot read property '_location' of null

0

There are 0 answers