How can I see formatted 'received' results with Jest?

Viewed 168

Using Jest, failed tests often look something like this:

  ● someThing › Try doing a thingr

    expect(received).toHaveLength(expected)

    Expected length: 6
    Received length: 7
    Received array: [massive chunk of unformatted JSON, as a wall of text]

I currently paste the output into an editor and format it, how how can I make jest show me the output in a human readable format (like a JSON.stringify(result, null, 2)) or util.inspect() would show)?

How can I see formatted 'received' results with Jest?

0 Answers
Related