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

@mh-code/angular-karma-reporter

v1.0.0

Published

A karma plugin for exporting unit test results as styled HTML file and statistic data

Downloads

3

Readme

angular-karma-reporter

This karam plugin is based on the npm package by Matthias Schuetz (GitHub).

Installation

Install the runner with this command.

npm install @mh-code/angular-karma-reporter --save-dev

Configuration

You can use nearly the same configuration (see below). The mandatory outputFile option was changed to outputDirectory. It specifies the directory in which to save the test results. The result files are named after the according project / sub-project.

// karma.conf.js
module.exports = function(config) {
  config.set({
    reporters: ['progress', 'aut-reporter'],

    htmlReporter: {
      outputDirectory: './test-results',
			
      // Optional
      pageTitle: 'Unit Tests',
      subPageTitle: 'A sample project description',
      groupSuites: true,
      useCompactStyle: true,
      useLegacyStyle: true,
      showOnlyFailed: false
    }
  });
};

Test result statistics

This plugin write information, like count of executed tests and how many succeeded, to the AutState. The AutRunner consumes these information to a test summary over all projects.

What is this plugin good for?

There is a problem with the Karma htmlfile reporter. It has a fixed name for the output file. The value from the outputFile configuration. The test results are saved in a file with the configured name. In an angular project with multiple sub projects and libraries, the reporter saves after each sub-project. At the end there is only one file with the results of the last tested sub-project.

This plugin saves one file per sub project. Furthermore, options for easy customization of branding, styling and behavior are planned.


A karma plugin for exporting unit test results as styled HTML file

This is a plugin for the [Karma Test Runner]. By adding this reporter to your karma configuration, unit test results will be exported as a styled HTML file. For each test browser, a separate table is generated. The plugin is based on the [karma-junit-reporter plugin].

HTML test result page

Version 0.3 comes with a fresh style from David G Chung. You can see a preview of the exported unit test result page here. A new option called groupSuites will group separate suites (describe blocks in test files) visually, see an example output here. You can also set the option useCompactStyle to true to export a more compact HTML output. The legacy page style is online here. If you want to use the legacy style, you can set the option useLegacyStyle to true. There's also an additional option called showOnlyFailed which forces the report to display failed tests only.