emulateNetwork()
Activates emulation of network conditions.
Examples
Section titled “Examples”# Emulate offline conditionsawait emulateNetwork("Offline")# Emulate slow network conditionsawait emulateNetwork("Good2G")# Emulate precise network conditionsawait emulateNetwork({ offline: false, downloadThroughput: 6400, uploadThroughput: 2560, latency: 500 })# Emulate precise network conditions with any subset of these properties, with default fallbacks of `offline` as true and all numbers as 0await emulateNetwork({ downloadThroughput: 6400, uploadThroughput: 2560, latency: 500 })Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
networkType | string | object | ’GPRS’,‘Regular2G’,‘Good2G’,‘Good3G’,‘Regular3G’,‘Regular4G’,‘DSL’,‘WiFi’,‘Offline’, {offline: boolean, downloadThroughput: number, uploadThroughput: number, latency: number} |
Returns
Section titled “Returns”| Type | Description |
|---|---|
Promise<void> |