Skip to content

Commit

Permalink
test: disable no-control-regex for color regex
Browse files Browse the repository at this point in the history
Added eslint-disable comment to bypass no-control-regex.
This allows testing ANSI escape sequences for red color
in error messages without triggering lint errors.

Fixes: nodejs#55922
  • Loading branch information
hpatel292-seneca committed Nov 27, 2024
1 parent 3e4d5e6 commit 4048621
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions test/parallel/test-runner-coverage-thresholds.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ for (const coverage of coverages) {
});

const stdout = result.stdout.toString();
// eslint-disable-next-line no-control-regex
const redColorRegex = /\u001b\[31mℹ Error: \d{2}\.\d{2}% \w+ coverage does not meet threshold of 99%/;
assert.match(stdout, redColorRegex, 'Expected red color code not found in diagnostic message');
assert.strictEqual(result.status, 1);
Expand Down

0 comments on commit 4048621

Please sign in to comment.