Skip to content

Commit

Permalink
Merge pull request #5714 from NomicFoundation/galargh/test-reporter-s…
Browse files Browse the repository at this point in the history
…tack-cleanup

feat: hide node and test runner internals from the stack
  • Loading branch information
galargh authored Sep 11, 2024
2 parents 3982ce2 + bfe4015 commit bb64e38
Show file tree
Hide file tree
Showing 23 changed files with 810 additions and 5,020 deletions.
1 change: 1 addition & 0 deletions v-next/hardhat-node-test-reporter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ It will:
- try to print the diff of the expected and actual values of the error object, if they are available;
- print internal errors of aggregated errors;
- truncate error cause stack traces after 3 levels;
- hide node internals (including test runner internals) from the stack trace;
- replace file URLs with relative paths (this should work on Windows, too).

### Diagnostics
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -4,74 +4,28 @@
2) error with circular cause in top level test


0 passing (520ms)
0 passing (524ms)
2 failing

1) aggregate error in top level test:

AggregateError: All promises were rejected
[inner]: Error: Promise 1 failed
 at TestContext.<anonymous> (integration-tests/fixture-tests/errors-test/test.ts:5:5)
 at Test.runInAsyncScope (node:async_hooks:206:9)
 at Test.run (node:internal/test_runner/test:856:25)
 at Test.processPendingSubtests (node:internal/test_runner/test:565:18)
 at node:internal/test_runner/harness:248:12
 at node:internal/process/task_queues:140:7
 at AsyncResource.runInAsyncScope (node:async_hooks:206:9)
 at AsyncResource.runMicrotask (node:internal/process/task_queues:137:8)
[cause]: Error: Promise 1 cause
 at TestContext.<anonymous> (integration-tests/fixture-tests/errors-test/test.ts:6:14)
 at Test.runInAsyncScope (node:async_hooks:206:9)
 at Test.run (node:internal/test_runner/test:856:25)
 at Test.processPendingSubtests (node:internal/test_runner/test:565:18)
 at node:internal/test_runner/harness:248:12
 at node:internal/process/task_queues:140:7
 at AsyncResource.runInAsyncScope (node:async_hooks:206:9)
 at AsyncResource.runMicrotask (node:internal/process/task_queues:137:8)
[cause]: AggregateError
 at TestContext.<anonymous> (integration-tests/fixture-tests/errors-test/test.ts:7:16)
 at Test.runInAsyncScope (node:async_hooks:206:9)
 at Test.run (node:internal/test_runner/test:856:25)
 at Test.processPendingSubtests (node:internal/test_runner/test:565:18)
 at node:internal/test_runner/harness:248:12
 at node:internal/process/task_queues:140:7
 at AsyncResource.runInAsyncScope (node:async_hooks:206:9)
 at AsyncResource.runMicrotask (node:internal/process/task_queues:137:8)
[inner]: Error: Promise 2 failed
 at TestContext.<anonymous> (integration-tests/fixture-tests/errors-test/test.ts:11:35)
 at Test.runInAsyncScope (node:async_hooks:206:9)
 at Test.run (node:internal/test_runner/test:856:25)
 at Test.processPendingSubtests (node:internal/test_runner/test:565:18)
 at node:internal/test_runner/harness:248:12
 at node:internal/process/task_queues:140:7
 at AsyncResource.runInAsyncScope (node:async_hooks:206:9)
 at AsyncResource.runMicrotask (node:internal/process/task_queues:137:8)

2) error with circular cause in top level test:

Error: circular error
 at TestContext.<anonymous> (integration-tests/fixture-tests/errors-test/test.ts:17:17)
 at Test.runInAsyncScope (node:async_hooks:206:9)
 at Test.run (node:internal/test_runner/test:856:25)
 at Test.processPendingSubtests (node:internal/test_runner/test:565:18)
 at Test.postRun (node:internal/test_runner/test:955:19)
 at Test.run (node:internal/test_runner/test:898:12)
 at async Test.processPendingSubtests (node:internal/test_runner/test:565:7)
[cause]: Error: circular error
 at TestContext.<anonymous> (integration-tests/fixture-tests/errors-test/test.ts:17:17)
 at Test.runInAsyncScope (node:async_hooks:206:9)
 at Test.run (node:internal/test_runner/test:856:25)
 at Test.processPendingSubtests (node:internal/test_runner/test:565:18)
 at Test.postRun (node:internal/test_runner/test:955:19)
 at Test.run (node:internal/test_runner/test:898:12)
 at async Test.processPendingSubtests (node:internal/test_runner/test:565:7)
[cause]: Error: circular error
 at TestContext.<anonymous> (integration-tests/fixture-tests/errors-test/test.ts:17:17)
 at Test.runInAsyncScope (node:async_hooks:206:9)
 at Test.run (node:internal/test_runner/test:856:25)
 at Test.processPendingSubtests (node:internal/test_runner/test:565:18)
 at Test.postRun (node:internal/test_runner/test:955:19)
 at Test.run (node:internal/test_runner/test:898:12)
 at async Test.processPendingSubtests (node:internal/test_runner/test:565:7)
[cause]: The error chain has been truncated because it's too long (limit: 3)

Loading

0 comments on commit bb64e38

Please sign in to comment.