summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGautam Mittal <200mittalgautam@gmail.com>2017-05-26 08:55:18 -0400
committerMichael Dawson <michael_dawson@ca.ibm.com>2017-06-06 11:55:15 -0400
commit3630ed1c827fd02e447b733865ebd6214b478a41 (patch)
tree8a81f85e2a0e8c79ce4fba077a17c671d5bc9f41 /test
parentf06c05cf5a2c2678a76c15adbe7f3acbc9478617 (diff)
downloadandroid-node-v8-3630ed1c827fd02e447b733865ebd6214b478a41.tar.gz
android-node-v8-3630ed1c827fd02e447b733865ebd6214b478a41.tar.bz2
android-node-v8-3630ed1c827fd02e447b733865ebd6214b478a41.zip
errors,tty: migrate to use internal/errors.js
PR-URL: https://github.com/nodejs/node/pull/13240 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Diffstat (limited to 'test')
-rw-r--r--test/parallel/test-ttywrap-invalid-fd.js16
1 files changed, 12 insertions, 4 deletions
diff --git a/test/parallel/test-ttywrap-invalid-fd.js b/test/parallel/test-ttywrap-invalid-fd.js
index b78bc689b2..2f3dc778a0 100644
--- a/test/parallel/test-ttywrap-invalid-fd.js
+++ b/test/parallel/test-ttywrap-invalid-fd.js
@@ -1,14 +1,17 @@
'use strict';
-
const common = require('../common');
const assert = require('assert');
const fs = require('fs');
const tty = require('tty');
-
assert.throws(() => {
new tty.WriteStream(-1);
-}, /fd must be positive integer:/);
+}, common.expectsError({
+ code: 'ERR_INVALID_FD',
+ type: RangeError,
+ message: '"fd" must be a positive integer: -1'
+})
+);
const err_regex = common.isWindows ?
/^Error: EBADF: bad file descriptor, uv_tty_init$/ :
@@ -24,7 +27,12 @@ assert.throws(() => {
assert.throws(() => {
new tty.ReadStream(-1);
-}, /fd must be positive integer:/);
+}, common.expectsError({
+ code: 'ERR_INVALID_FD',
+ type: RangeError,
+ message: '"fd" must be a positive integer: -1'
+})
+);
assert.throws(() => {
let fd = 2;