toBeInverse
Deprecated
Prefer toHaveAttrs which checks multiple attributes at once:
typescript
expect(term.cell(0, 0)).toHaveAttrs({ inverse: true })Assert that a cell has inverse video (foreground and background colors swapped).
Signature
typescript
expect(cell).toBeInverse()Usage
typescript
// Check a specific cell
expect(term.cell(0, 0)).toBeInverse()
// Negation
expect(term.cell(0, 5)).not.toBeInverse()Accepts
| Region | Supported |
|---|---|
term.cell(r, c) | Yes |
term.screen | No |
term.row(n) | No |
Notes
- Inverse video (SGR attribute 7) swaps the foreground and background colors
- Commonly used for selections and highlighted text in TUI applications
See Also
- toHaveAttrs - composable attribute matcher (preferred)
- toHaveFg - foreground color assertion
- toHaveBg - background color assertion
- toBeBold - bold styling