I am trying to write an Electron launcher for the test runner testem. Testem prints to the terminal the test results from each of it's launchers (forked processes where tests get executed, traditionally browsers but in this case Electron). Testem wants to set the tty to 'Raw Mode' so it can make a faux-tabbed view that appears to update live, and lets the user navigate between tabs to see results from different launchers.
I'm seeing this error in my terminal after testem tries to call process.stdin.setRawMode
(on node v4.0.0 on OS X Yosimite):
TypeError: Cannot read property 'setRawMode' of null at ReadStream.setRawMode (tty.js:49:15) at module.exports.View.extend.setRawMode (/Users/beane/Code/yeti-desktop/node_modules/testem/lib/dev/ui/appview.js:255:21) at module.exports.View.extend.cleanup (/Users/beane/Code/yeti-desktop/node_modules/testem/lib/dev/ui/appview.js:265:10) at EventEmitter.App.cleanupView (/Users/beane/Code/yeti-desktop/node_modules/testem/lib/dev/index.js:254:15) at /Users/beane/Code/yeti-desktop/node_modules/testem/lib/dev/index.js:230:14 at /Users/beane/Code/yeti-desktop/node_modules/testem/lib/dev/index.js:325:23 at Object.HookRunner.run (/Users/beane/Code/yeti-desktop/node_modules/testem/lib/hook_runner.js:13:14) at EventEmitter.App.runHook (/Users/beane/Code/yeti-desktop/node_modules/testem/lib/dev/index.js:322:12) at EventEmitter.App.runExitHook (/Users/beane/Code/yeti-desktop/node_modules/testem/lib/dev/index.js:312:10) at /Users/beane/Code/yeti-desktop/node_modules/testem/lib/dev/index.js:229:12 at /Users/beane/Code/yeti-desktop/node_modules/testem/node_modules/async/lib/async.js:52:16 at Object.async.forEachOf.async.eachOf (/Users/beane/Code/yeti-desktop/node_modules/testem/node_modules/async/lib/async.js:236:30) at Object.async.forEach.async.each (/Users/beane/Code/yeti-desktop/node_modules/testem/node_modules/async/lib/async.js:209:22) at EventEmitter.App.cleanUpLaunchers (/Users/beane/Code/yeti-desktop/node_modules/testem/lib/dev/index.js:365:11) at EventEmitter.App.quit (/Users/beane/Code/yeti-desktop/node_modules/testem/lib/dev/index.js:228:10) at process.App.quiteGracefully (/Users/beane/Code/yeti-desktop/node_modules/testem/lib/dev/index.js:43:10)
The stacktrace begins at tty.js:49 from node core. Here's the function where the error is thrown from:
ReadStream.prototype.setRawMode = function(flag) {
flag = !!flag;
this._handle.setRawMode(flag);
this.isRaw = flag;
};
What I can't seem to figure out is what the heck this._handle
is. Testem is not expecting it to be null, but for some reason it is. Can anyone help me out with this?