Skip to content

Commit d37f845

Browse files
authored
Ignore console collor in message listener test (#343)
One of the message listener tests fails on some versions of Node 20 because it is not expecting console output to use control characters for color. Make the test look only for the expected message and ignore any other characters.
1 parent 05fdcff commit d37f845

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

test/runtime/messageListeners-test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ describe('ConsoleMessageListener', () => {
1818
const listener = new ConsoleMessageListener();
1919
listener.onMessage('My Source', 'test', 'Error', 'Hello World!');
2020
stdoutInspect.output.should.have.length(0);
21-
22-
// stderr seems to always outputs line feed
23-
stderrInspect.output.should.eql([`Error: [test] Hello World!\n`]);
21+
stderrInspect.output.should.have.length(1);
22+
stderrInspect.output[0].should.match(/Error: \[test\] Hello World!/);
2423
});
2524

2625
it('should log a Warning to stdout', () => {

0 commit comments

Comments
 (0)