[API reference](https://evolu.dev/docs/api-reference) › [@evolu/common](https://evolu.dev/docs/api-reference/common) › [Test](https://evolu.dev/docs/api-reference/common/Test) › testCreateId

```ts
function testCreateId(): TestCreateId;
```

Defined in: [packages/common/src/Test.ts:54](https://github.com/evoluhq/evolu/blob/037c390af081e9944d616ff298a729515c5c5ab7/packages/common/src/Test.ts#L54)

Creates a deterministic `createId` helper.

The returned function mirrors [createId](https://evolu.dev/docs/api-reference/common/Type/functions/createId), but uses stable test entropy
so each call yields the next deterministic pseudo-random id.

Create one helper per test, or per reusable test setup helper such as
`setupFoo`, so deterministic ids stay local to that setup.

Avoid sharing one helper across a whole test file. Adding an extra `createId`
call in one test would shift ids used by unrelated tests later in the file.

### Example

```ts
import {
  assertEqual,
  assertType,
  testCreateId,
  type Brand,
  type Id,
} from "@evolu/common";

const createId = testCreateId();

const callbackId = createId();
const secondCallbackId = createId();
const todoId = createId<"Todo">();
assertEqual(new Set([callbackId, secondCallbackId, todoId]).size, 3);

const replayCreateId = testCreateId();
assertEqual(replayCreateId(), callbackId);
assertType<Id & Brand<"Todo">, typeof todoId>();
```