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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use fancy diffs for node's assert.deepEqual #1400

Closed
wants to merge 1 commit into from

Conversation

glenjamin
Copy link
Contributor

Is there a reason why only opted-in 3rd-party libraries get the fancy coloured/unified diff feature?

I wasn't sure, so here's a PR that detects node core's deepEqual and lets it get the nice diff behaviour. 馃帀

@boneskull
Copy link
Member

@glenjamin So it appears when the assert module throws an Error, it stuffs an operator property into the Error? Is this documented anywhere?

@boneskull boneskull added the status: waiting for author waiting on response from OP - more information needed label Dec 15, 2014
@glenjamin
Copy link
Contributor Author

It's not documented extremely well, I might send a PR up to Node core to make it explicit.

The assert module is marked as "Stable", so should not change anymore.

This function hints at this behvaiour:
http://nodejs.org/docs/latest/api/assert.html#assert_assert_fail_actual_expected_message_operator

And here's the AssertionError constructor:
https://github.com/joyent/node/blob/master/lib/assert.js#L40

@jbnicolai
Copy link

@boneskull @glenjamin is there anything holding of a merge?

@jbnicolai
Copy link

This PR is currently no longer mergable, and with the inclusion of unexpectedjs I think it's no longer relevant either.

Feel free to update if you think it still adds value though, and thanks for the effort!

@jbnicolai jbnicolai closed this Jul 4, 2015
@glenjamin
Copy link
Contributor Author

Could you point me towards the PR for the unexpected change you're referring to? I tried to search but couldn't seem to find anything.

The specific aim here was to improve formatting when using Node core's assert.deepEqual, I'm happy to rebase the PR.

@jbnicolai
Copy link

This one (which was indeed tricky to find): #1349

But now that I'm looking at it, it seems this was only for the HTML reporter. If you'd like to rebase your changes I'd be happy to have an other look at merging them :)

@jbnicolai jbnicolai reopened this Jul 4, 2015
@glenjamin
Copy link
Contributor Author

I looked into this a bit more, the change is no longer needed due to #1626 which changes the default behaviour to always show diffs.

@glenjamin glenjamin closed this Jul 4, 2015
@glenjamin glenjamin deleted the diff-deep-equal branch July 4, 2015 20:45
@jbnicolai
Copy link

@glenjamin 馃憤 thanks

@boneskull boneskull removed the status: waiting for author waiting on response from OP - more information needed label Dec 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants