diff options
author | davidmarkclements <huperekchuno@googlemail.com> | 2018-04-12 21:00:24 +0200 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2018-04-14 11:33:43 -0700 |
commit | 8826cc985acc5588185a1af84260bbaaf7f7c19c (patch) | |
tree | f804998ad51024f2ddf4c8dc9465154b914b079c /test/parallel/test-repl-options.js | |
parent | 6dca62b28d3432c11fedc13f3942125097cd3ec5 (diff) | |
download | android-node-v8-8826cc985acc5588185a1af84260bbaaf7f7c19c.tar.gz android-node-v8-8826cc985acc5588185a1af84260bbaaf7f7c19c.tar.bz2 android-node-v8-8826cc985acc5588185a1af84260bbaaf7f7c19c.zip |
errors: alter and test ERR_INVALID_REPL_EVAL_CONFIG
changes the base instance for ERR_INVALID_REPL_EVAL_CONFIG
from Error to TypeError as a more accurate representation
of the error and adds a unit test for the repl options that
trigger this error.
PR-URL: https://github.com/nodejs/node/pull/19984
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Diffstat (limited to 'test/parallel/test-repl-options.js')
-rw-r--r-- | test/parallel/test-repl-options.js | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/test/parallel/test-repl-options.js b/test/parallel/test-repl-options.js index 3b373669ed..6bd908aadf 100644 --- a/test/parallel/test-repl-options.js +++ b/test/parallel/test-repl-options.js @@ -89,7 +89,19 @@ assert.strictEqual(r2.rli.input, r2.inputStream); assert.strictEqual(r2.rli.output, r2.outputStream); assert.strictEqual(r2.rli.terminal, false); -// Verify that defaults are used when no arguments are provided +// 3, breakEvalOnSigint and eval supplied together should cause a throw +const r3 = () => repl.start({ + breakEvalOnSigint: true, + eval: true +}); + +common.expectsError(r3, { + code: 'ERR_INVALID_REPL_EVAL_CONFIG', + type: TypeError, + message: 'Cannot specify both "breakEvalOnSigint" and "eval" for REPL' +}); + +// 4, Verify that defaults are used when no arguments are provided const r4 = repl.start(); assert.strictEqual(r4._prompt, '> '); |