Skip to content

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

RegionSupported
term.cell(r, c)Yes
term.screenNo
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