Skip to content

Commit

Permalink
no-useless-concat
Browse files Browse the repository at this point in the history
  • Loading branch information
jcbhmr committed Aug 19, 2023
1 parent e5e02c1 commit 89d9c43
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/parallel/test-util-format.js
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ assert.strictEqual(

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

assert.strictEqual(
Expand All @@ -544,17 +544,17 @@ assert.strictEqual(
'%cfoo',
'color: red; background-color: blue'
),
'\x1B[44m' + '\x1B[31m' + 'foo' + '\x1B[0m'
'\x1B[44m\x1B[31mfoo\x1B[0m'
);

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

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

assert.strictEqual(
Expand All @@ -564,5 +564,5 @@ assert.strictEqual(
'color: red',
'color: blue'
),
'\x1b[31m' + 'foo ' + '\x1b[34m' + 'bar' + '\x1b[0m'
'\x1b[31mfoo \x1b[34mbar\x1b[0m'
);

0 comments on commit 89d9c43

Please sign in to comment.