---
url: >-
  https://game-engine-io.github.io/enginex-frontend-sdk/reference/api/@getenginex/sdk-predictions/testing/functions/withPredictionsRoutes.md
---
[Reference](../../../../index.md) / [@getenginex/sdk-predictions/testing](../index.md) / withPredictionsRoutes

# withPredictionsRoutes()

> **withPredictionsRoutes**(`options?`): [`MockFetchOptions`](../../../sdk/testing/interfaces/MockFetchOptions.md)

Adds the predictions mock routes ([createPredictionsRoutes](createPredictionsRoutes.md)) 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`](../../../sdk/testing/interfaces/MockFetchOptions.md) = `{}`

The options you would pass to `createMockFetch`.

## Returns

[`MockFetchOptions`](../../../sdk/testing/interfaces/MockFetchOptions.md)

## 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)
```
