Skip to content

Commit b743da5

Browse files
committed
Prevent outputting Node.js internal error stack frames.
See: tapjs/stack-utils#63 .
1 parent 525717e commit b743da5

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Diff for: changelog.md

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
- Replaced the package `prepare` script with a `jsdoc` script.
1414
- Added a package `test:jsdoc` script that checks the readme API docs are up to date with the source JSDoc.
1515
- Also run GitHub Actions CI with Node.js v17.
16+
- Prevent outputting the Node.js internal `async Promise.all (index 0)` error stack frame generated by recent Node.js versions that [`stack-utils`](https://npm.im/stack-utils) fails to clean, (see [tapjs/stack-utils#63](https://github.com/tapjs/stack-utils/issues/63)).
1617
- Readme tweaks.
1718

1819
## 6.0.0

Diff for: index.mjs

+5-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,11 @@ export default class TestDirector {
148148
: error.stack
149149
)
150150
// Remove leading or trailing newlines.
151-
.trim();
151+
.trim()
152+
// Remove an internal Node.js frame generated by recent Node.js
153+
// versions that stack-utils fails to clean, see:
154+
// https://github.com/tapjs/stack-utils/issues/63
155+
.replace(/(?:\r\n?|\n)async Promise\.all \(index 0\)$/u, '');
152156

153157
// Sometimes nothing remains of the stack after cleaning, e.g. for
154158
// filesystem errors that have an identical error message and stack.

0 commit comments

Comments
 (0)