Skip to content

console.log() does not work in the test runner #43034

Closed
@jim-king-2000

Description

@jim-king-2000

Version

v18.1.0

Platform

Win11

Subsystem

No response

What steps will reproduce the bug?

Use test runner in node v18 to run the test.

test('synchronous passing test', (t) => {
  console.log('abc');
  assert.strictEqual(1, 1);
});

Run the code above and notice that string abc is not printed in the console.

How often does it reproduce? Is there a required condition?

everytime

What is the expected behavior?

We could use console.log() in test runner.

What do you see instead?

console.log() does not work in test runner.

Additional information

We need output some debug information during the test. We were like a blind when nothing could be printed to the console.

Metadata

Metadata

Assignees

No one assigned

    Labels

    test_runnerIssues and PRs related to the test runner subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions