avajs / avajs/ava

Officially expose assertion error properties on `t.try()` results

Open
#2,248 0 comments 0 reactions 0 assignees View on GitHub
enhancement scope:assertions
Dominant language
JavaScript
Stars
20.8k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

#1947 landed a new `t.try()` assertion. We haven't yet figured out what assertion error details we want to expose.

For reference:

```js
const attempt = await t.try(tt => {
tt.is(true, false)
})

const [error] = attempt.errors
// What should we define on this `error` object?
```

See: https://github.com/avajs/ava/blob/67e4deac2857503e5fac7d38da2d23014eb29724/lib/assert.js#L36

Some of these properties are internal, others are outdated. So let's hash out which ones we're comfortable exposing and supporting.

Contributor guide

Open the contributing guide

Research direction

Start by reading lib/assert.js around line 36 and the existing t.try() behavior introduced in #1947. Review which assertion error properties are currently present, then determine which details should be officially exposed and supported on attempt.errors. Done means the public error shape has been agreed and documented or tested.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
15/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.