> ## 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.

# checkPresenceWhileDisconnected()

> Function exported by @botmesh/core/testing.

```ts theme={null}
function checkPresenceWhileDisconnected(provider, probe): Promise<CapabilityViolation[]>;
```

Defined in: [testing/capabilityContract.ts:137](https://github.com/andresayac/botmesh/blob/main/packages/core/src/testing/capabilityContract.ts#L137)

Check the "PRESENCE WHILE DISCONNECTED" rule of `IProvider` on a provider that is NOT
connected (never started, or stopped): `typing()` (each state) and `markRead()` must
resolve without contacting the transport. Give the provider a transport that fails when
contacted (a `fetch` or socket that throws), so a call that reaches it rejects and is
reported. Empty array = conforming; a provider without the methods has nothing to check.

## Parameters

| Parameter | Type |
| - | - |
| `provider` | `Partial`\<[`IProvider`](https://botmesh.afaya.com.co/api/core/interfaces/IProvider)> |
| `probe` | [`PresenceProbe`](https://botmesh.afaya.com.co/api/core/testing/interfaces/PresenceProbe) |

## Returns

`Promise`\<[`CapabilityViolation`](https://botmesh.afaya.com.co/api/core/testing/interfaces/CapabilityViolation)\[]>

## Example

```ts theme={null}
import { assertPresenceWhileDisconnected } from '@botmesh/core/testing'

await assertPresenceWhileDisconnected(new MyProvider({ fetch: offlineFetch }), { chatId: '123' })
```


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