node/test/pseudo-tty/test-tty-stdout-end.js
Jeremiah Senkpiel aab306679e test: fix old tty tests
test-tty-wrap hasn’t worked since StreamBase was introduced, I think.
test-tty-stdout-end also happens to works with PipeWrap-s.

Refs: https://github.com/nodejs/node/pull/7360
PR-URL: https://github.com/nodejs/node/pull/7613
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2016-07-11 15:22:09 +02:00

15 lines
300 B
JavaScript

'use strict';
require('../common');
const assert = require('assert');
const shouldThrow = function() {
process.stdout.end();
};
const validateError = function(e) {
return e instanceof Error &&
e.message === 'process.stdout cannot be closed.';
};
assert.throws(shouldThrow, validateError);