Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

print expected value on equals assertion #101

Closed
wants to merge 3 commits into from

Conversation

@scottty881
Copy link
Contributor

scottty881 commented May 31, 2017

open to suggestions on other ways of printing both the actual and expected value on a failed equals assertion, this is a shot in the dark

@@ -275,7 +275,7 @@ internals.equal = function (value, options) {
const compare = this._flags.shallow ? (a, b) => a === b
: (a, b) => Hoek.deepEqual(a, b, settings);

return this.assert(compare(this._ref, value), 'equal specified value', this._ref, value);
return this.assert(compare(this._ref, value), `equal specified value: ${JSON.stringify(value)}`, this._ref, value);

This comment has been minimized.

Copy link
@cjihrig

cjihrig Jun 1, 2017

Contributor

I think this should use util.inspect() instead of JSON.stringify().

@cjihrig

This comment has been minimized.

Copy link
Contributor

cjihrig commented Jun 1, 2017

I just updated code to work on Node 8, so you should rebase too.

@cjihrig cjihrig self-assigned this Jun 1, 2017
@cjihrig cjihrig added the feature label Jun 1, 2017
@cjihrig cjihrig added this to the 4.1.0 milestone Jun 1, 2017
@cjihrig

This comment has been minimized.

Copy link
Contributor

cjihrig commented Jun 1, 2017

Landed in 38df73b. Thanks!

@cjihrig cjihrig closed this Jun 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.