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

"actual" value is not printed if actual happened to be "undefined" #1177

Closed
mo opened this Issue May 14, 2017 · 5 comments

Comments

2 participants
@mo
Copy link

mo commented May 14, 2017

Using qunitjs 2.3.2, the test below fails to print the "actual" value, just because sum() happened to return undefined as the incorrect/buggy value. If it returned "wrong" instead, the "actual" is printed next to the "expected" so it's easier to see what went wrong. If a string value was expected and undefined was returned instead, then it would be nicer if qunit printed "actual: undefined" to make that clear.

var isCurrentlyBuggy = true;

function sum(a, b) {
  if (isCurrentlyBuggy) {
    return undefined;
  }
  return a + b;
}

QUnit.only('my test', assert => {
  assert.equal(sum(1, 1), 2);
});
@trentmwillis

This comment has been minimized.

Copy link
Member

trentmwillis commented May 16, 2017

This seems reasonable and likely an easy fix. Would you mind attempting a PR?

@mo

This comment has been minimized.

Copy link

mo commented May 17, 2017

@mo

This comment has been minimized.

Copy link

mo commented May 17, 2017

@trentmwillis

This comment has been minimized.

Copy link
Member

trentmwillis commented Jul 4, 2017

I finally released js-reporters@1.2.1 which should fix this issue.

@mo

This comment has been minimized.

Copy link

mo commented Jul 4, 2017

great, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment