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

17 lines
380 B
JavaScript
Raw Normal View History

'use strict';
// 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-10 14:51:16 -08:00
var exceptionCaught = false;
2011-11-10 14:51:16 -08:00
try {
process.stdout.end();
2012-01-17 19:43:34 +01:00
} catch (e) {
2011-11-10 14:51:16 -08:00
exceptionCaught = true;
assert.ok(common.isError(e));
2012-01-27 13:42:08 -08:00
assert.equal('process.stdout cannot be closed.', e.message);
2011-11-10 14:51:16 -08:00
}
assert.ok(exceptionCaught);