Skip to content

First stderr entry shares timestamp with preceding stdout entry in custom reporters #10307

@aslushnikov

Description

@aslushnikov

Describe the bug

When a test writes to stdout and then later to stderr, the time on the stderr UserConsoleLog matches the timestamp of the preceding stdout entry rather than the actual time stderr was written.

Reproduction

it('test-1', async () => {
  await new Promise(x => setTimeout(x, 50));
  console.log('foo');
  await new Promise(x => setTimeout(x, 100));
  console.error('bar');
});

In onUserConsoleLog, the bar entry's time equals the foo entry's time, despite being ~100ms apart in real time.

System Info

N/A

Used Package Manager

npm

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    p3-minor-bugAn edge case that only affects very specific usage (priority)

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions