qunitjs/qunit

Support DOM nodes in TapReporter value formatting

Opened this issue · 0 comments

Tell us about your runtime:

  • QUnit version: 3.0.0-alpha.2
  • Which environment are you using? (e.g., browser, Node): Browser

What are you trying to do?

QUnit.reporters.tap.init(QUnit);

QUnit.test('HtmlReporter disabled', function (assert) {
  var children = [].slice.call(document.querySelectorAll('#qunit > *'));
  assert.deepEqual(children, [], '#qunit element is empty');
});

What did you expect to happen?

The TAP output in the console should be able to format DOM nodes, similar to how we format them in the HTML output.

Historically, we used the TAP reporter mainly in Node.js, but when using it to relay test results from a remote browser, this becomes more important.

<div id="example"></div>

What actually happened?

DOM nodes render as {}.

Screenshot

Other information

If we fix this, that would also make it more attractive to utilize TAP in grunt-contrib-qunit, where currently DOM nodes also aren't formatted.

Screenshot