As part of the bigger problem I am trying to solve smaller problems first and hence below is the code to find the terminal width and height.
Code
'use strict';
class Terminal {
width() {
return process.stdout.columns || 80
}
height() {
return process.stdout.rows || 60
}
}
module.exports = Terminal
How can I make the above code testable? can I use some better abstraction?