summaryrefslogtreecommitdiff
path: root/test/pseudo-tty/test-tty-stdout-end.js
diff options
context:
space:
mode:
authorJames M Snell <jasnell@gmail.com>2017-02-10 08:51:50 -0800
committerJames M Snell <jasnell@gmail.com>2017-04-20 11:34:07 -0700
commite75bc87d2240097ddf4074c473b4ea946daf390d (patch)
treeed03f175a3efe6ed40ee30e96131f73c81734f7b /test/pseudo-tty/test-tty-stdout-end.js
parent468275ac7911b3f7950f31e9799b6666c96f2c73 (diff)
downloadandroid-node-v8-e75bc87d2240097ddf4074c473b4ea946daf390d.tar.gz
android-node-v8-e75bc87d2240097ddf4074c473b4ea946daf390d.tar.bz2
android-node-v8-e75bc87d2240097ddf4074c473b4ea946daf390d.zip
errors: port internal/process errors to internal/errors
* Assign codes to the handful of errors reported by internal/process/*.js * Include documentation for the new error codes * Improve error messages * Improve test coverage for process.nextTick PR-URL: https://github.com/nodejs/node/pull/11294 Ref: https://github.com/nodejs/node/issues/11273 Reviewed-By: Michaƫl Zasso <targos@protonmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com>
Diffstat (limited to 'test/pseudo-tty/test-tty-stdout-end.js')
-rw-r--r--test/pseudo-tty/test-tty-stdout-end.js18
1 files changed, 7 insertions, 11 deletions
diff --git a/test/pseudo-tty/test-tty-stdout-end.js b/test/pseudo-tty/test-tty-stdout-end.js
index 86a42c4035..3c91977f90 100644
--- a/test/pseudo-tty/test-tty-stdout-end.js
+++ b/test/pseudo-tty/test-tty-stdout-end.js
@@ -1,14 +1,10 @@
'use strict';
-require('../common');
+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);
+assert.throws(() => process.stdout.end(),
+ common.expectsError({
+ code: 'ERR_STDOUT_CLOSE',
+ type: Error,
+ message: 'process.stdout cannot be closed'
+ }));