0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
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 23:51:16 +01:00
var exceptionCaught = false;
2011-11-10 23:51:16 +01:00
try {
process.stdout.end();
2012-01-17 19:43:34 +01:00
} catch (e) {
2011-11-10 23:51:16 +01:00
exceptionCaught = true;
assert.ok(common.isError(e));
2012-01-27 22:42:08 +01:00
assert.equal('process.stdout cannot be closed.', e.message);
2011-11-10 23:51:16 +01:00
}
assert.ok(exceptionCaught);