Ava: Retain internal stack lines for errors, but color differently

Created on 24 Feb 2020  路  5Comments  路  Source: avajs/ava

It would be quite useful because there's sometimes missing context.

enhancement help wanted internals reporters

Most helpful comment

@szmarczak so you filed https://github.com/avajs/ava/issues/2110 last year, which is pretty similar 馃槈

There's a PR to fix that one (https://github.com/avajs/ava/pull/2420) which is great. However I think we should still consider retaining the internal stack lines for all errors, whether or not they originated outside of user code, and use color to indicate their relevance.

So we'll keep this issue open.

All 5 comments

Could you provide more, uhm, context?

I see what you did here :P

Example:

  PromisableRequest._destroy (dist/source/core/index.js:935:21)
  PromisableRequest._beforeError (dist/source/core/index.js:855:14)
  dist/source/core/index.js:262:22

Full stack trace:

    at PromisableRequest._destroy (/home/szm/Desktop/got/dist/source/core/index.js:935:21)
    at PromisableRequest.destroy (internal/streams/destroy.js:55:8)
    at PromisableRequest._beforeError (/home/szm/Desktop/got/dist/source/core/index.js:855:14)
    at /home/szm/Desktop/got/dist/source/core/index.js:262:22
    at processTicksAndRejections (internal/process/task_queues.js:97:5)

I think that at PromisableRequest.destroy (internal/streams/destroy.js:55:8) is quite important. Without this AVA implies that _beforeError called _destroy directly.

Yea I don't really know why we even do this. If anything, we should use colors and separators to highlight the most useful lines, but not remove anything. Other than AVA-introduced lines.

IIRC this happens in https://github.com/avajs/ava/blob/master/lib/beautify-stack.js.

@szmarczak so you filed https://github.com/avajs/ava/issues/2110 last year, which is pretty similar 馃槈

There's a PR to fix that one (https://github.com/avajs/ava/pull/2420) which is great. However I think we should still consider retaining the internal stack lines for all errors, whether or not they originated outside of user code, and use color to indicate their relevance.

So we'll keep this issue open.

However I think we should still consider retaining the internal stack lines for all errors, whether or not they originated outside of user code, and use color to indicate their relevance.

I think this was addressed in #2420 as well.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

clitetailor picture clitetailor  路  3Comments

sindresorhus picture sindresorhus  路  4Comments

ivogabe picture ivogabe  路  5Comments

fleg picture fleg  路  3Comments

sindresorhus picture sindresorhus  路  5Comments