[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:48](https://github.com/evoluhq/evolu/blob/a18269a1b822c670b507c6a9b73b23eed32551fe/packages/common/src/Test.ts#L48)

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

const createId = testCreateId();

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

const replayCreateId = testCreateId();
expect(replayCreateId()).toBe(callbackId);
expectTypeOf(todoId).toEqualTypeOf<Id & Brand<"Todo">>();
```