# testing.recordInvocations

- **Module:** testing
- **Package:** libtmux
- **Language:** TypeScript
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-ts/blob/46cccfef2a546de55ce8b308249b8c76339089a0/packages/libtmux/src/testing.ts#L218
- **Page:** https://libtmux.org/en/ts/latest/reference/testing-recordinvocations/

```
function recordInvocations(
  inner: TmuxEngine = new NodeSpawnTransport(),
): {
  readonly engine: TmuxEngine;
  readonly recording: () => TmuxRecording;
}
```

Wrap an engine so every invocation it runs is written down.

The wrapper is transparent: it answers exactly what the inner engine
answered, so a suite can record while it runs against real tmux and keep
asserting on the real results. Called with nothing it wraps the engine a
[`Server`](/en/ts/latest/reference/server-server/) builds for itself, which is what recording against a local tmux
means and saves reaching for an internal class to say so.

## Parameters

- `inner` (`TmuxEngine`)
  Default: `new NodeSpawnTransport()`.
