moll / js-must

An assertion library for JavaScript and Node.js with a friendly BDD syntax (awesome.must.be.true()). It ships with many expressive matchers and is test runner and framework agnostic. Follows RFC 2119 with its use of MUST. Good stuff and well tested.
Other
336 stars 35 forks source link

Must.prototype.assert's stringification of a Promise is non-informative #72

Open jandppw opened 6 years ago

jandppw commented 6 years ago

Must.prototyp.assert generates a message that reads '${stringify(this.actual)} must …'.

When the actual is a Promise, this produces the less informative representation '{}'.

To add insult to injury, in Node 0.10, it produces something like '{"_40": 2, "_70": null …}'. These 'numeric' properties are presumably some sort of Promise administration in Node 0.10.

What would be a good way to represent a Promise as actual?