Socket
Socket
Sign inDemoInstall

karma-jasmine-html-reporter

Package Overview
Dependencies
139
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    karma-jasmine-html-reporter

A Karma plugin. Dynamically displays tests results at debug.html page


Version published
Weekly downloads
1.8M
increased by5.14%
Maintainers
1
Install size
8.63 kB
Created
Weekly downloads
 

Package description

What is karma-jasmine-html-reporter?

The karma-jasmine-html-reporter npm package is a plugin for the Karma test runner that provides a visual HTML report of the results of Jasmine tests. It allows developers to see their test results in a more readable and user-friendly format directly in the browser.

What are karma-jasmine-html-reporter's main functionalities?

Visual HTML Test Results

This feature allows you to see your Jasmine test results in a formatted HTML output. The code sample shows how to configure Karma to use the karma-jasmine-html-reporter by adding 'kjhtml' to the list of reporters and including the plugin in the Karma configuration.

module.exports = function(config) {
  config.set({
    reporters: ['progress', 'kjhtml'],
    plugins: [
      require('karma-jasmine'),
      require('karma-chrome-launcher'),
      require('karma-jasmine-html-reporter')
    ]
  });
};

Debugging Support

The reporter supports interactive debugging by leaving the Jasmine Spec Runner output visible in the browser. The 'clearContext' option is set to false to keep the HTML output visible, allowing developers to inspect and debug directly.

module.exports = function(config) {
  config.set({
    reporters: ['kjhtml'],
    client: {
      clearContext: false // leave Jasmine Spec Runner output visible in browser
    }
  });
};

Other packages similar to karma-jasmine-html-reporter

Readme

Source

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 Versionkarma-jasmine-html-reporter version
2.x0.2.2
3.x1.x
4.x2.x

Keywords

FAQs

Last updated on 05 Jun 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc