avajs/ava

Make t.fail() accept an object

Open

#2,615 创建于 2020年11月25日

在 GitHub 查看
 (5 评论) (1 反应) (0 负责人)JavaScript (20,600 star) (1,408 fork)batch import
enhancementhelp wantedscope:assertions

描述

It seems like the only problem with #1094 is providing detailed error output when a custom assertion fails. Everything else is straightforward. What if t.fail() could accept an object to use for creating an AssertionError? The fields could be message, actual, expected, and format that will specifying which formatting function to use for setting the values field on the error object. Could also add an optional assertion field for a custom assertion name.

Would this be compatible with #2435?

If there's interest, I can submit a PR for this.

贡献者指南

Make t.fail() accept an object · avajs/ava#2615 | Good First Issue