npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

tap-junit

v5.0.4

Published

Silly small, silly easy junit output formatter for tap.

Downloads

34,197

Readme

GitHub Actions Workflow Status npm Downloads

tap-junit

Silly small, silly easy junit output formatter for tap.

Works with tape and other tap based tests just pipe it into tap-junit

Parameters

  • -c, --classname - The name you want to apply to the testsuite element (if not set no name is given to the output testsuite)
  • -o, --output - designate where you want the .xml results to output
    • If you do not specify an output then results will be displayed within the terminal
  • -n, --name - value provided will be the name of the output.xml file, otherwise defaults to tap.xml
  • -s, --suite - sets the main test suite name defaults to Tap-Junit if not passed
  • -v, --version - displays the current tap-junit version
  • -i, --input - Specify a specific tap txt input file to transform
  • -p, --pretty - Specify if you want the output xml to be prettified or not this is false by default

Installation

npm i -D tap-junit

Usage

tape test/*.js | tap-junit --output output/test

node test.js | ./node_modules/tap-junit/bin/tap-junit --output output/test

tap-junit -o output/tests -n nontape < src/test/non-tape.tap

tape tests/thing.js | tap-junit > output/thing.xml

tap-junit -i tap.txt -s suite-name

You can now use custom extensions (in version 3.1.0+) simply add the extension to the end of your file name. If none is provided tap-junit will still default to .xml

tape test/*.js | tap-junit -o output/tests -n tape.xuni

The above will create a file called tape.xuni in the output/tests directory with the results inside.

Output

Tap-Junit currently follows this spec on junit syntax/layout

<testsuites tests="4" name="Tap-Junit" failures="2">
  <testsuite tests="4" failures="2" skipped="1">
    <testcase id="1" name="test is equal"/>
    <testcase id="2" name="test skip extra # SKIP">
      <skipped/>
    </testcase>
    <testcase id="3" name="should not be equal"/>
    <testcase id="4" name="should be equal"/>
  </testsuite>
</testsuites>

Comments

So Tap Junit takes a tape style assumption when it comes to comments. That being, when a comment appears before a test (because that's how tape labels its tap output) it will be registered as a comment for that test, but the issue here is that you may lose placed comments in your tap files.

At the moment, I'm still trying to figure out a decent way to handle comments and record them. Keep this in mind that only a single comment before each test will currently be recorded for a system-out tag.

If you have ideas on how to better handle this, don't hesitate to reach out!