We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0b90b07 commit d7ba75fCopy full SHA for d7ba75f
1 file changed
test/parallel/test-console-tty-colors.js
@@ -44,3 +44,27 @@ check(true, true, true);
44
check(false, true, true);
45
check(true, false, false);
46
check(false, false, false);
47
+
48
+// check invalid colorMode type
49
+{
50
+ const stream = new Writable({
51
+ write: common.mustNotCall()
52
+ });
53
54
+ [0, 'true', null, {}, [], () => {}].forEach((colorMode) => {
55
+ const received = util.inspect(colorMode);
56
+ assert.throws(
57
+ () => {
58
+ new Console({
59
+ stdout: stream,
60
+ ignoreErrors: false,
61
+ colorMode: colorMode
62
63
+ },
64
+ {
65
+ message: `The argument 'colorMode' is invalid. Received ${received}`,
66
+ code: 'ERR_INVALID_ARG_VALUE'
67
+ }
68
+ );
69
70
+}
0 commit comments