We are building an RN app with the Pubnub publish-subscribe SDK included. Apparently this SDK relies on long-polling data. So, when running a detox test with an open Pubnub subscription, it will always time out, because it will wait forever for the connection to close.
When running with debug-synchronization this is the output:
detox info Sync App State: Waiting for network requests to finish.: (
detox info Sync "https://ps16.pndsn.com/v2/subscribe/sub-c-xxx/xxx/0?heartbeat=300&tt=123&tr=123&uuid=123&pnsdk=PubNub-JS-ReactNative%2F4.15.1&auth=xxx"
detox info Sync )
Is there a way to manually ignore that connection? I have also found How do we turn off automatic synchronization?, but this isn't useable yet, is it?
You're right, this section of the docs was not updated.
Here is the related API you need: https://github.com/wix/detox/blob/master/docs/APIRef.DeviceObjectAPI.md#deviceseturlblacklisturls
I'll update the docs and close this issue, please keep it open till docs are updated.
Thanks!
Docs are updated
Thank you very much for that fast and helpful response!
Using device.setURLBlacklist(['.*pndsn\\.com.*'])works perfectly!
One small thing, though. In the docs for setURLBlacklist() it says to block urls like this: '.*my.ignored.endpoint.*'. But shouldn't it be a regex, as stated in the EarlGrey docs? So the dot should be escaped?
You're probably right, I believe this is a mistake in our docs