mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
5bbc6df7de
common.Error() is just util.isError() which is deprecated. Use assert.throws() instead. PR-URL: https://github.com/nodejs/node/pull/3084 Reviewed-By: Michaël Zasso <mic.besace@gmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
16 lines
387 B
JavaScript
16 lines
387 B
JavaScript
'use strict';
|
|
// Can't test this when 'make test' doesn't assign a tty to the stdout.
|
|
const common = 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);
|