---
url: https://canary.warp-drive.io/api/@warp-drive/holodeck/functions/setTestId.md
description: >-
  Assigns a test context its Holodeck test id before a test, or clears it after,
  reporting an error for any mock the test never requested.
---

# &#x20;setTestId()

```ts
function setTestId(context: object, str: string | null): void;
```

Defined in: [index.ts:155](https://github.com/warp-drive-data/warp-drive/blob/48dc0d277b98008082669dadc6a52e5c5682ef8e/packages/holodeck/src/index.ts#L155)

## Parameters

### context

`object`

### str

`string` | `null`

## Returns

`void`
