1. karma-jasmine-html-reporter
A Karma plugin. Dynamically displays tests results at debug.html page
karma-jasmine-html-reporter
Package: karma-jasmine-html-reporter
Created by: dfederm
Last modified: Mon, 05 Jun 2023 04:31:41 GMT
Version: 2.1.0
License: MIT
Downloads: 7,007,175
Repository: https://github.com/dfederm/karma-jasmine-html-reporter

Install

npm install karma-jasmine-html-reporter
yarn add karma-jasmine-html-reporter

karma-jasmine-html-reporter

npm version npm downloads

Reporter that dynamically shows tests results at debug.html page.

alt tag

You can also run a describe block, or a single test.

alt tag

Installation

You can simply install karma-jasmine-html-reporter as a devDependency by:

 npm install karma-jasmine-html-reporter --save-dev

Configuration

 // karma.conf.js
module.exports = function(config) {
  config.set({
    frameworks: ['jasmine'],
    plugins: [
        require('karma-jasmine'),
        require('karma-jasmine-html-reporter')
    ],
    client: {
        jasmine: {
            // you can add configuration options for Jasmine here
            // the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
            // for example, you can disable the random execution with `random: false`
            // or set a specific seed with `seed: 4321`
        }
    },
    reporters: ['kjhtml']
  });
};

With options

In combination with multiple reporters you may want to disable terminal messages because it's already handled by another reporter.

Example using the 'karma-mocha-reporter' plugin:

 // karma.conf.js
module.exports = function(config) {
  config.set({

    // Combine multiple reporters
    reporters: ['kjhtml', 'mocha'],

    jasmineHtmlReporter: {
      suppressAll: true, // Suppress all messages (overrides other suppress settings)
      suppressFailed: true // Suppress failed messages
    }

  });
};

You can pass a list of reporters as a CLI argument too:

 karma start --reporters kjhtml

Version compatibility

jasmine Version karma-jasmine-html-reporter version
2.x 0.2.2
3.x 1.x
4.x 2.x

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code