Reference / @getenginex/sdk-predictions/testing / withPredictionsRoutes
withPredictionsRoutes()
withPredictionsRoutes(
options?):MockFetchOptions
Adds the predictions mock routes (createPredictionsRoutes) to the options of createMockFetch from @getenginex/sdk/testing. The core routes still apply; the ones in options.routes win over the predictions ones (to simulate errors). The other options (twoFactorRequired, withdrawalOtp, user) pass through as they are, and options is not changed.
Parameters
options?
MockFetchOptions = {}
The options you would pass to createMockFetch.
Returns
Example
ts
import { createEnginexClient } from '@getenginex/sdk'
import { createMockFetch } from '@getenginex/sdk/testing'
import { createPredictions } from '@getenginex/sdk-predictions'
import { withPredictionsRoutes } from '@getenginex/sdk-predictions/testing'
const enginex = createEnginexClient({
baseUrl: 'https://gateway.test', // in Node: absolute baseUrl + tenantHost (optional in the browser)
tenantHost: 'casino.test',
fetch: createMockFetch(withPredictionsRoutes()),
})
const predictions = createPredictions(enginex)