Skip to content

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

@mo

Description

@mo

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);
});

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions