Skip to content

mocha reporter should unwrap ERR_TEST_FAILURE #124

Closed

Description

@cjihrig

A failing test is currently displayed like this:

     Error [ERR_TEST_FAILURE]: should be a number: expected 'hello' to be a number
      at async Promise.all (index 0)
     Caused by: AssertionError: should be a number: expected 'hello' to be a number
      at TestContext.<anonymous>
      at Test.runInAsyncScope (node:async_hooks:206:9)
      at Test.run (node:internal/test_runner/test:865:25)
      at Suite.processPendingSubtests (node:internal/test_runner/test:574:18)
      at Test.postRun (node:internal/test_runner/test:964:19)
      at Test.run (node:internal/test_runner/test:907:12)
      at async Promise.all (index 0)
      at async Suite.run (node:internal/test_runner/test:1226:7)
      at async Test.processPendingSubtests (node:internal/test_runner/test:574:7)

Compared to mocha:

     AssertionError: should be a number: expected 'hello' to be a number
      at Context.<anonymous>
      at process.processImmediate (node:internal/timers:483:21)

I guess the ERR_TEST_FAILURE should be unwrapped. There are a number of extra stack frames too, but I'm not sure if that's important.

Activity

  1. cjihrig commented on Aug 18, 2024

    @cjihrig
    Author
  2. MoLow commented on Aug 19, 2024

    @MoLow
    Owner

    Will take a look once I am back from vacation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions