diff --git a/lib/internal/util/inspect.js b/lib/internal/util/inspect.js index c611eb97fc0755..f8480aa1d4821d 100644 --- a/lib/internal/util/inspect.js +++ b/lib/internal/util/inspect.js @@ -485,7 +485,7 @@ function defineColorAlias(target, alias) { this[target] = value; }, configurable: true, - enumerable: false, + enumerable: true, }); } diff --git a/test/parallel/test-util-inspect.js b/test/parallel/test-util-inspect.js index e60320d0591233..ca4c0498d69877 100644 --- a/test/parallel/test-util-inspect.js +++ b/test/parallel/test-util-inspect.js @@ -2405,11 +2405,11 @@ assert.strictEqual( ); rejection.catch(() => {}); - // Verify that aliases do not show up as key while checking `inspect.colors`. + // Verify that aliases should show up as key while checking `inspect.colors`. const colors = Object.keys(inspect.colors); const aliases = Object.getOwnPropertyNames(inspect.colors) .filter((c) => !colors.includes(c)); - assert(!colors.includes('grey')); + assert(colors.includes('grey')); assert(colors.includes('gray')); // Verify that all aliases are correctly mapped. for (const alias of aliases) { diff --git a/test/parallel/test-util-styletext.js b/test/parallel/test-util-styletext.js index 4fdf419143453c..2b3e4952676447 100644 --- a/test/parallel/test-util-styletext.js +++ b/test/parallel/test-util-styletext.js @@ -22,6 +22,7 @@ const noChange = 'test'; util.styleText(invalidOption, 'test'); }, { code: 'ERR_INVALID_ARG_VALUE', + message: /grey/, // gray alias }, invalidOption); assert.throws(() => { util.styleText('red', invalidOption);