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

x-feature-reporter

v3.0.0

Published

Generates or updates documentation with the results of a test run. Not intended to be used directly. Rather, use it as a base for your custom reporter.

Downloads

1,346

Readme

X-Feature Reporter

Generates or updates documentation with the results of a test run. Not intended to be used directly. Rather, use it as a base for your custom reporter.

Existing reporters:

(want to add your own? open a PR!)

Reporters

x-feature-reporter accepts a standardized javascript object that represents a test run with results. It then performs some transformations and hands off the data to an adapter for output.

Usually, a reporter will be created to convert a test framework's native output format into the standardized format. The reporter will instantiate XFeatureReporter with an adapter, and then call generateReport with the test results.

For example, if you're using Playwright and want to publish your test results to a markdown file (which is what this project is doing), you can use the playwright-feature-reporter project, which uses x-feature-reporter as a base.

An additional example is jest-feature-reporter, which publishes Jest test results to markdown.

Adapters

x-feature-reporter uses adapters to support different output formats. The default adapter is Markdown, but you can easily implement your own adapter. For example, you could implement an adapter for outputting to Word, PDF, or even publishing via an API to slack or notion.

x-feature-reporter is additionally bundled with a JSON adapter, which outputs the standardized, transformed data as a JSON file. This can be useful if you want to further process the data (for example, combine it with the results of other test runs).

You can supply your own adapter by implementing the XAdapter interface.

Usage example

In your own reporter, you can use x-feature-reporter as follows:

const xsuite = {/* your test results */} as XTestSuite;
const reporter = new XFeatureReporter(new MyCustomAdapter({
      ...myCustomAdapterOptions
}));
reporter.generateReport(xsuite);

Features

The below section was generated using Playwright-feature-reporter, which is based on this library.

Markdown generation

Suites (headings)

  • ✅ Suites appear as headings. Nested Suites are nested headings
  • ✅ Suites can be marked as transparent: They will not be printed but their children will be printed
  • ✅ Suites with the same name have their results merged, and the heading is shown only once
  • ✅ Suites containing only non-behavioral tests are not shown in the report

TestResults (features)

  • ✅ TestResults appear as list items representing features. Each feature is visually marked as Passing ✅, Failing ❌ or Skipped 🚧
  • ✅ Only XTestResults with testType 'behavior' appear as features. If testType is note specified, it's assumed to be 'behavior'
  • ✅ Features can nest under other features using a '-' prefix
    • ✅ Features can nest multiple levels deep using multiple '-' prefixes

Embedding

  • ✅ The features list is embedded in an existing file between placeholders
  • ✅ The closing placeholder can be ommitted if the feature list is intended as the last content in the file

Options

  • ✅ Placeholder prefix can be specified using the 'embeddingPlaceholder' option
  • ✅ A link to a full test report will be included when the 'fullReportLink' option is provided

JSON generation

  • ✅ Generates a JSON file
  • 🚧 Suites can be marked as transparent: They will not be printed but their children will be printed

Test report