fix(testrunner): attribute unhandle promise reject to a single worker (#1491)

When there is a single worker, we are almost sure the error originated in that worker. Attributing it helps with context by showing last run tests.
This commit is contained in:
Dmitry Gozman 2020-03-23 14:45:21 -07:00 committed by GitHub
parent de0a2d1081
commit 63906454a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -411,7 +411,7 @@ class TestPass {
if (error) {
if (error.stack)
await this._runner._sourceMapSupport.rewriteStackTraceWithSourceMaps(error);
this._result.addError(message, error);
this._result.addError(message, error, this._workers.length === 1 ? this._workers[0] : null);
}
}