Calculating the terminal width and height
What is the functionality of this class?
Get width and height from process.stdout,
an external resource,
or else fall back to default values.

You can make this testable by making it possible to inject process.stdout, the external resource.
Then in the test you can inject an object that you control,
and verify that Terminal uses that object correctly or else falls back to the defaults correctly.

To make process.stdout injectable, you have at least two options:


Add an optional constructor argument. By default use process.stdout, only the test method will inject a custom object.
Add a _stdout function, that will be used by width and height, and in the test override it appropriately.