MCPcopy Index your code
hub / github.com/nodejs/node / testColorStyle

Function testColorStyle

test/parallel/test-util-inspect.js:963–976  ·  view source on GitHub ↗
(style, input)

Source from the content-addressed store, hash-verified

961// Test util.inspect.styles and util.inspect.colors.
962{
963 function testColorStyle(style, input) {
964 const colorName = util.inspect.styles[style];
965 let color = ['', ''];
966 if (util.inspect.colors[colorName])
967 color = util.inspect.colors[colorName];
968
969 const withoutColor = util.inspect(input, false, 0, false);
970 const withColor = util.inspect(input, false, 0, true);
971 const expect = `\u001b[${color[0]}m${withoutColor}\u001b[${color[1]}m`;
972 assert.strictEqual(
973 withColor,
974 expect,
975 `util.inspect color for style ${style}`);
976 }
977
978 testColorStyle('special', function() {});
979 testColorStyle('number', 123.456);

Callers 1

Calls 1

inspectMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…