How it works #

Instead of describing “what good looks like” in terms of fixed test cases, you express general properties of your system, defining how it should behave in all cases. Bombadil checks each property as it explores your system in its chaotic ways, reporting back any violations.

To test a terminal application using Bombadil, you write a specification in TypeScript that exports properties and action generators. These can be domain-specific — to exercise and validate your application’s logic in custom ways — or be imported from Bombadil’s defaults. Bombadil drives any program that reads from stdin and writes to a terminal, whether it’s a traditional CLI, an interactive REPL, or a full TUI.

Conceptually, it runs in a loop doing the following:

  1. Extracts the current state from the terminal
  2. Checks all properties against the current state, recording violations1
  3. Selects the next action based on the current state, and performs it
  4. Waits for the next event (chunk of output bytes or timeout)
  5. Returns to step 1

Bombadil itself decides what is an interesting event and when to capture state. You provide the properties and actions, Bombadil does the rest!


  1. You can also configure Bombadil to exit on the first found violation.↩︎