qunitjs / qunitjs/qunit

Support DOM nodes in TapReporter value formatting

Open
#1,783 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Component: Core Type: Bug
Dominant language
JavaScript
Stars
4k
Forks
773
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at QUnit.reporters.tap.init(QUnit) and trace the TAP reporter's value formatting for the browser DOM-node example in the issue. Done means DOM nodes render as HTML-like output rather than {}, with the behavior checked in a browser; the payload names no specific test file.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
testing
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.