Skip to content

Commit

Permalink
move to more appropriate file
Browse files Browse the repository at this point in the history
  • Loading branch information
jcbhmr committed Aug 19, 2023
1 parent 1c3fa1b commit e5e02c1
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 44 deletions.
44 changes: 0 additions & 44 deletions test/parallel/test-format-c.js

This file was deleted.

34 changes: 34 additions & 0 deletions test/parallel/test-util-format.js
Original file line number Diff line number Diff line change
Expand Up @@ -532,3 +532,37 @@ assert.strictEqual(
message: /"inspectOptions".+object/
});
});

assert.strictEqual(
util.formatWithOptions({ colors: true }, '%cfoo', 'color: red'),
'\x1b[31m' + 'foo' + '\x1b[0m'
);

assert.strictEqual(
util.formatWithOptions(
{ colors: true },
'%cfoo',
'color: red; background-color: blue'
),
'\x1B[44m' + '\x1B[31m' + 'foo' + '\x1B[0m'
);

assert.strictEqual(
util.formatWithOptions({ colors: true }, '%cfoo', 'color: red', 'bar'),
'\x1b[31m' + 'foo' + '\x1b[0m' + ' bar'
);

assert.strictEqual(
util.formatWithOptions({ colors: true }, '%cfoo%c bar', 'color: red', ''),
'\x1b[31m' + 'foo' + '\x1b[39m' + ' bar' + '\x1b[0m'
);

assert.strictEqual(
util.formatWithOptions(
{ colors: true },
'%cfoo %cbar',
'color: red',
'color: blue'
),
'\x1b[31m' + 'foo ' + '\x1b[34m' + 'bar' + '\x1b[0m'
);

0 comments on commit e5e02c1

Please sign in to comment.