> ## Documentation Index
> Fetch the complete documentation index at: https://botmesh.afaya.com.co/llms.txt
> Use this file to discover all available pages before exploring further.

# checkIdentityContract()

> Function exported by @botmesh/core/testing.

```ts theme={null}
function checkIdentityContract(
   events, 
   expectations?, 
   options?
): IdentityViolation[];
```

Defined in: [testing/identityContract.ts:150](https://github.com/andresayac/botmesh/blob/main/packages/core/src/testing/identityContract.ts#L150)

Check normalized events against the identity stability contract and return
every violation (empty array = conforming). Non-identity events (connection,
status, …) are skipped but keep their index.

## Parameters

| Parameter | Type |
| - | - |
| `events` | readonly [`IdentityEventInput`](https://botmesh.afaya.com.co/api/core/testing/type-aliases/IdentityEventInput)\[] |
| `expectations?` | [`IdentityExpectations`](https://botmesh.afaya.com.co/api/core/testing/type-aliases/IdentityExpectations) |
| `options?` | [`IdentityContractOptions`](https://botmesh.afaya.com.co/api/core/testing/interfaces/IdentityContractOptions) |

## Returns

[`IdentityViolation`](https://botmesh.afaya.com.co/api/core/testing/interfaces/IdentityViolation)\[]


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.