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

mocha-munit-reporter

v0.3.4

Published

Basically as JUnit doesn't allow you to generate a nice report that has nested sections/describes, we created this report format.

Downloads

94

Readme

Munit - mocha js reporter for nested suites

Basically as JUnit doesn't allow you to generate a nice report that has nested sections/describes, we created this report format.

Usage

mocha test --reporter=mocha-munit-reporter --reporter-options name="Acceptance Test" xmlfile="report.xml"

You can pass any of the below options to get the desired result from the reporter.

reporterOptions:

  • name: of the report (string)
  • xmlPrettyPrint: whether or not we generate a xml file with new lines (bool)
  • runXml: whether or not to generate xml (bool)
  • spec: whether or not to output the tests as they run (bool)
  • xmlfile: path that the xml file is written to (string)
  • skipTimeout: so if a test takes less than this time e.g. if a test takes 0.0001 and our timeout is 0.001 then we mark it as skipped, useful for manual test cases (float/number)
  • parseComments: so if we want to parse the body of a test for comments with steps,notes, etc. in or not (boolean)

Typical use cases:

  • you want to have case steps and nested sections: you can leave it at the default config
  • you want just the nested sections: set skipTimeout = 0 and parseComments = false (as setting skipTimeout to 0 will disable skipped based on duration)

tests

test coverage is for generating the tree and xml validation npm test

Please add or update tests when changing the reporter!

xml spec

This is similar other formats but just allows more details for each case.

<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="sections" >
        <xs:complexType>
            <xs:complexContent>
                <xs:extension base="sectionType">
                    <xs:attribute type="xs:string" name="timestamp" use="required"/>
                </xs:extension>
            </xs:complexContent>
        </xs:complexType>
    </xs:element>
    
    <xs:complexType name = "caseType">
        <xs:sequence maxOccurs="unbounded">
            <xs:element name = "failure" type = "xs:string" minOccurs="0" maxOccurs="1"/>
            <xs:element name = "note" type = "xs:string" minOccurs="0" maxOccurs="1"/>
            <xs:element name = "step" type = "xs:string" minOccurs="0" maxOccurs="1"/>
            <xs:element name = "expected" type = "xs:string" minOccurs="0" maxOccurs="1"/>
            <xs:element name = "actual" type = "xs:string" minOccurs="0" maxOccurs="1"/>
        </xs:sequence>
        <xs:attribute type="xs:string" name="name"/>
        <xs:attribute type="xs:short" name="tests"/>
        <xs:attribute type="xs:int" name="failures"/>
        <xs:attribute type="xs:boolean" name="skipped"/>
        <xs:attribute type="xs:double" name="time"/>
    </xs:complexType>

    <xs:complexType name = "sectionType">
        <xs:sequence>
            <xs:element name="case" type="caseType" maxOccurs="unbounded" minOccurs="0"></xs:element>
            <xs:element name="section" type="sectionType" maxOccurs="unbounded" minOccurs="0"></xs:element>
        </xs:sequence>
        <xs:attribute type="xs:string" name="name" use="required"/>
        <xs:attribute type="xs:int" name="tests" use="required"/>
        <xs:attribute type="xs:int" name="failures" use="required"/>
        <xs:attribute type="xs:int" name="skipped" use="required"/>
        <xs:attribute type="xs:double" name="time" use="required"/>
    </xs:complexType>
    
</xs:schema>

MIT License

Copyright (c) [2018] [SquaredUp]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.