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

# ok()

> **ok**(`data`, `meta?`, `status?`): `Response`

Success response in the gateway format (`{ success: true, data, meta? }`), ready for a
[MockHandler](../type-aliases/MockHandler.md) handler. `status` defaults to `200`; use `201` to mimic creation routes.

## Parameters

### data

`unknown`

### meta?

`Record`<`string`, `unknown`>

### status?

`number` = `200`

## Returns

`Response`

## Examples

```ts
createMockFetch({ routes: { 'GET /api/v1/config/products': () => ok({ products: [] }) } })
```

```ts
createMockFetch({ routes: { 'POST /api/v1/pix-keys': () => ok({ id: 'pk-1' }, undefined, 201) } })
```
