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

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

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

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

mo opened this issue May 14, 2017 · 5 comments

Comments

@mo
Copy link
Contributor

@mo 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
Copy link
Member

@trentmwillis trentmwillis commented May 16, 2017

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

@mo
Copy link
Contributor Author

@mo mo commented May 17, 2017

@mo
Copy link
Contributor Author

@mo mo commented May 17, 2017

@trentmwillis
Copy link
Member

@trentmwillis trentmwillis commented Jul 4, 2017

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

@mo
Copy link
Contributor Author

@mo 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
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants