GithubHelp home page GithubHelp logo

Comments (1)

Krinkle avatar Krinkle commented on June 23, 2024

@david-pfx I'm interested in exploring this, and like the idea of allowing rich text formatting. This would unlock many interesting features.

QUnit output is often passed through (or presented in) contexts where there is no HTML support. For example, most CI systems these days present build output as plain text (Jenkins, Travis CI, GitHub Actions, etc.). This includes e.g. when one uses cross-browser runners such as Karma, Headless Chrome via grunt-contrib-qunit, cloud browsers such via browserstack-runner, or e.g. when using QUnit to test a Node.js package.

Other examples exist within the browser, when using the TAP reporter, which prints to the browser console. While this is testing frontend JavaScript inside a browser, the web page is empty, with the QUnit results printed in the browser console.

If your need is mainly to make links clickable, perhaps an alternative would be for QUnit to do what browsers, terminals, and CI systems also do with their output - they automaticlaly scan for URLs in the plain text, and turn them into clickable links. Would that work for you?

A few other ideas based on your HTML proposal:

  • QUnit could render the HTML code as unparsed HTML in these contexts. This seems suboptimal as that would look broken.
  • QUnit could try to strip the HTML tags and render the remaining text. This would be fine for simple text styling, but for links this would make the URL inaccessible.
  • QUnit could require that, if you specify an HTML message, that you also specify a plain text version. This would place extra work on developers and make for a more complicated Assertion API.

from qunit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.