Skip to content

toHaveCursorHidden

Deprecated

Prefer toHaveCursor which checks multiple cursor properties at once:

typescript
expect(term).toHaveCursor({ visible: false })

Assert that the terminal cursor is hidden.

Signature

typescript
expect(term).toHaveCursorHidden(options?: { timeout?: number })

Parameters

ParameterTypeDescription
options.timeoutnumberAuto-retry timeout in ms (Playwright-style)

Usage

typescript
// Assert cursor is hidden (e.g., after DECTCEM hide)
expect(term).toHaveCursorHidden()

// With auto-retry
await expect(term).toHaveCursorHidden({ timeout: 5000 })

// Negation
expect(term).not.toHaveCursorHidden()

Accepts

TargetSupported
term (TerminalReadable)Yes
term.screenNo
term.cell(r, c)No

Notes

  • TUI applications typically hide the cursor during rendering and show it at the input position

See Also