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

16 lines
372 B
JavaScript

'use strict';
// Can't test this when 'make test' doesn't assign a tty to the stdout.
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);