node/test/parallel/test-tty-stdout-end.js

16 lines
366 B
JavaScript
Raw Normal View History

// Can't test this when 'make test' doesn't assign a tty to the stdout.
var common = require('../common');
var assert = require('assert');
2011-11-11 06:51:16 +08:00
var exceptionCaught = false;
2011-11-11 06:51:16 +08:00
try {
process.stdout.end();
2012-01-18 02:43:34 +08:00
} catch (e) {
2011-11-11 06:51:16 +08:00
exceptionCaught = true;
assert.ok(common.isError(e));
2012-01-28 05:42:08 +08:00
assert.equal('process.stdout cannot be closed.', e.message);
2011-11-11 06:51:16 +08:00
}
assert.ok(exceptionCaught);