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

15 lines
300 B
JavaScript
Raw Normal View History

'use strict';
require('../common');
const assert = require('assert');
const shouldThrow = function() {
2011-11-11 06:51:16 +08:00
process.stdout.end();
};
const validateError = function(e) {
return e instanceof Error &&
e.message === 'process.stdout cannot be closed.';
};
2011-11-11 06:51:16 +08:00
assert.throws(shouldThrow, validateError);