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
Labels
Component: HTML Reporter good first issue Is straight-forward to start with and someone can guide you Type: Enhancement

Comments

@mo
Copy link
Contributor

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

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

@trentmwillis trentmwillis added Type: Enhancement good first issue Is straight-forward to start with and someone can guide you Component: HTML Reporter labels May 16, 2017
@mo
Copy link
Contributor Author

mo commented May 17, 2017

@mo
Copy link
Contributor Author

mo commented May 17, 2017

PR here: js-reporters/js-reporters#102

@trentmwillis
Copy link
Member

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

@mo
Copy link
Contributor Author

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
Labels
Component: HTML Reporter good first issue Is straight-forward to start with and someone can guide you Type: Enhancement
Development

No branches or pull requests

2 participants