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

Error messages for notEqual and notDeepEqual never display the expected value. #453

Closed
JoshuaGrams opened this issue Dec 21, 2018 · 5 comments

Comments

@JoshuaGrams
Copy link
Contributor

Any failing tests with t.notEqual or t.notDeepEqual always show the expected value as undefined because they return a result with a notExpected property (which is totally ignored) instead of the expected property which _assert actually looks at.

@ljharb
Copy link
Collaborator

ljharb commented Dec 22, 2018

Can you provide specific repro code?

JoshuaGrams added a commit to JoshuaGrams/tape that referenced this issue Dec 22, 2018
@JoshuaGrams
Copy link
Contributor Author

Oh, sorry. I wasn't sure it was worth including a one-liner. Actually, since you guys clearly don't care about the quality of your error output at all, I wasn't sure if anyone would even respond. Here's a full reproduction (and a pull request which brings it inline with notDeepLooseEqual).

const test = require('tape')

// Note that both of these failures say "expected: undefined"
test('notEqual error', (t) => {t.plan(1); t.notEqual(3, 3)})
test('notDeepEqual error', (t) => {t.plan(1); t.notDeepEqual(3, 3)})

// This one, on the other hand, says:
//    operator: notDeepLooseEqual
//    expected: 3
//    actual:   3
test('notDeepLooseEqual', (t) => {t.plan(1); t.notDeepLooseEqual(3, 3)})

@ljharb
Copy link
Collaborator

ljharb commented Dec 22, 2018

Wow, there's really no need to be hostile - we care about the quality of our error output very much.

@JoshuaGrams
Copy link
Contributor Author

If you have a six-year-old test harness code base where nobody has ever manually inspected the output of notEqual and notDeepEqual with an expected value other than undefined, then in practice you absolutely don't care about the quality of your error output at all, no matter what you might like to tell yourself. Talk is cheap.

@ljharb
Copy link
Collaborator

ljharb commented Dec 28, 2018

Again, no need to be hostile. If you never wrote your code incorrectly such that you saw that error output, how would you know it’s quality wasn’t up to snuff? As for this codebase, humans make mistakes - and that has zero bearing on “what they care about”.

Hostile talk is very expensive; please conduct yourself appropriately and professionally.

ljharb pushed a commit to JoshuaGrams/tape that referenced this issue Dec 28, 2018
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

No branches or pull requests

2 participants