-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5700 from NomicFoundation/galargh/test-reporter-s…
…tack feat: replace util.inspect with a custom stack parser
- Loading branch information
Showing
24 changed files
with
3,333 additions
and
3,003 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
945 changes: 945 additions & 0 deletions
945
...rdhat-node-test-reporter/integration-tests/fixture-tests/errors-test/result.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
77 changes: 77 additions & 0 deletions
77
v-next/hardhat-node-test-reporter/integration-tests/fixture-tests/errors-test/result.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
|
||
[31m1) aggregate error in top level test[39m | ||
|
||
[31m2) error with circular cause in top level test[39m | ||
|
||
|
||
[32m0 passing[39m[90m (520ms)[39m[31m[39m | ||
[31m2 failing[39m | ||
|
||
1) aggregate error in top level test: | ||
|
||
[31mAggregateError: All promises were rejected[39m | ||
[31m[inner]: Error: Promise 1 failed[39m | ||
[90m at TestContext.<anonymous> (integration-tests/fixture-tests/errors-test/test.ts:5:5)[39m | ||
[90m at Test.runInAsyncScope (node:async_hooks:206:9)[39m | ||
[90m at Test.run (node:internal/test_runner/test:856:25)[39m | ||
[90m at Test.processPendingSubtests (node:internal/test_runner/test:565:18)[39m | ||
[90m at node:internal/test_runner/harness:248:12[39m | ||
[90m at node:internal/process/task_queues:140:7[39m | ||
[90m at AsyncResource.runInAsyncScope (node:async_hooks:206:9)[39m | ||
[90m at AsyncResource.runMicrotask (node:internal/process/task_queues:137:8)[39m | ||
[90m[cause]: Error: Promise 1 cause[39m | ||
[90m at TestContext.<anonymous> (integration-tests/fixture-tests/errors-test/test.ts:6:14)[39m | ||
[90m at Test.runInAsyncScope (node:async_hooks:206:9)[39m | ||
[90m at Test.run (node:internal/test_runner/test:856:25)[39m | ||
[90m at Test.processPendingSubtests (node:internal/test_runner/test:565:18)[39m | ||
[90m at node:internal/test_runner/harness:248:12[39m | ||
[90m at node:internal/process/task_queues:140:7[39m | ||
[90m at AsyncResource.runInAsyncScope (node:async_hooks:206:9)[39m | ||
[90m at AsyncResource.runMicrotask (node:internal/process/task_queues:137:8)[39m | ||
[90m[cause]: AggregateError[39m | ||
[90m at TestContext.<anonymous> (integration-tests/fixture-tests/errors-test/test.ts:7:16)[39m | ||
[90m at Test.runInAsyncScope (node:async_hooks:206:9)[39m | ||
[90m at Test.run (node:internal/test_runner/test:856:25)[39m | ||
[90m at Test.processPendingSubtests (node:internal/test_runner/test:565:18)[39m | ||
[90m at node:internal/test_runner/harness:248:12[39m | ||
[90m at node:internal/process/task_queues:140:7[39m | ||
[90m at AsyncResource.runInAsyncScope (node:async_hooks:206:9)[39m | ||
[90m at AsyncResource.runMicrotask (node:internal/process/task_queues:137:8)[39m | ||
[31m[inner]: Error: Promise 2 failed[39m | ||
[90m at TestContext.<anonymous> (integration-tests/fixture-tests/errors-test/test.ts:11:35)[39m | ||
[90m at Test.runInAsyncScope (node:async_hooks:206:9)[39m | ||
[90m at Test.run (node:internal/test_runner/test:856:25)[39m | ||
[90m at Test.processPendingSubtests (node:internal/test_runner/test:565:18)[39m | ||
[90m at node:internal/test_runner/harness:248:12[39m | ||
[90m at node:internal/process/task_queues:140:7[39m | ||
[90m at AsyncResource.runInAsyncScope (node:async_hooks:206:9)[39m | ||
[90m at AsyncResource.runMicrotask (node:internal/process/task_queues:137:8)[39m | ||
|
||
2) error with circular cause in top level test: | ||
|
||
[31mError: circular error[39m | ||
[90m at TestContext.<anonymous> (integration-tests/fixture-tests/errors-test/test.ts:17:17)[39m | ||
[90m at Test.runInAsyncScope (node:async_hooks:206:9)[39m | ||
[90m at Test.run (node:internal/test_runner/test:856:25)[39m | ||
[90m at Test.processPendingSubtests (node:internal/test_runner/test:565:18)[39m | ||
[90m at Test.postRun (node:internal/test_runner/test:955:19)[39m | ||
[90m at Test.run (node:internal/test_runner/test:898:12)[39m | ||
[90m at async Test.processPendingSubtests (node:internal/test_runner/test:565:7)[39m | ||
[90m[cause]: Error: circular error[39m | ||
[90m at TestContext.<anonymous> (integration-tests/fixture-tests/errors-test/test.ts:17:17)[39m | ||
[90m at Test.runInAsyncScope (node:async_hooks:206:9)[39m | ||
[90m at Test.run (node:internal/test_runner/test:856:25)[39m | ||
[90m at Test.processPendingSubtests (node:internal/test_runner/test:565:18)[39m | ||
[90m at Test.postRun (node:internal/test_runner/test:955:19)[39m | ||
[90m at Test.run (node:internal/test_runner/test:898:12)[39m | ||
[90m at async Test.processPendingSubtests (node:internal/test_runner/test:565:7)[39m | ||
[90m[cause]: Error: circular error[39m | ||
[90m at TestContext.<anonymous> (integration-tests/fixture-tests/errors-test/test.ts:17:17)[39m | ||
[90m at Test.runInAsyncScope (node:async_hooks:206:9)[39m | ||
[90m at Test.run (node:internal/test_runner/test:856:25)[39m | ||
[90m at Test.processPendingSubtests (node:internal/test_runner/test:565:18)[39m | ||
[90m at Test.postRun (node:internal/test_runner/test:955:19)[39m | ||
[90m at Test.run (node:internal/test_runner/test:898:12)[39m | ||
[90m at async Test.processPendingSubtests (node:internal/test_runner/test:565:7)[39m | ||
[90m[cause]: The error chain has been truncated because it's too long (limit: 3)[39m | ||
|
20 changes: 20 additions & 0 deletions
20
v-next/hardhat-node-test-reporter/integration-tests/fixture-tests/errors-test/test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { test } from "node:test"; | ||
|
||
test("aggregate error in top level test", async () => { | ||
const promise1 = Promise.reject( | ||
new Error("Promise 1 failed", { | ||
cause: new Error("Promise 1 cause", { | ||
cause: new AggregateError([new Error("A"), new Error("B")]), | ||
}), | ||
}), | ||
); | ||
const promise2 = Promise.reject(new Error("Promise 2 failed")); | ||
|
||
return Promise.any([promise1, promise2]); | ||
}); | ||
|
||
test("error with circular cause in top level test", async () => { | ||
const error = new Error("circular error"); | ||
error.cause = error; | ||
throw error; | ||
}); |
Oops, something went wrong.