Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mutation-testing-elements

Package Overview
Dependencies
Maintainers
1
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mutation-testing-elements

A suite of web components for a mutation testing report.

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
42K
decreased by-54.09%
Maintainers
1
Weekly downloads
 
Created
Source

Build Status

Mutation testing elements

A suite of elements designed to display a mutation testing report.

Directory result example

File result example

Note: Please see https://stryker-mutator.io for an introduction to mutation testing.

Features

The mutation test report supports the following features:

📊 Calculates and displays the mutation score and other metrics
📁 Group results into directories
👓 Show mutants directly in your source code
😎 Code highlighting with highlightjs
🧙‍ Filter mutants based on the outcome
🔗 Deep linking using anchors (uses fragment, so path will not be contaminated)
✨ A nice (yet basic) UI with embedded bootstrap css
🎓 Adheres to custom element best practices

Install

Install with npm:

$ npm install mutation-testing-elements

Add to your page:

<script defer src="mutation-test-elements/dist/mutation-test-elements.js"></script>

Or you can use the unpkg as your CDN:

<script defer src="https://www.unpkg.com/mutation-testing-elements"></script>

Usage

Use the mutation-test-report-app element to load the mutation test report.

<mutation-test-report-app src="mutation-report.json" title-postfix="Mutation Test Report"></mutation-test-report-app>

This loads the report from the source (src) and displays it.

Alternatively, you can use property binding directly:

<mutation-test-report-app></mutation-test-report-app>
<script>
    document.getElementsByTagName('mutation-test-report-app').item(0).report = {
        /* ... */
    }
</script>

Feel free to use other ways to bind the report property. For example, you can use <mutation-test-report-app [report]="myReport"></mutation-test-report-app> to bind report to the myReport property in an Angular component.

Mutation testing report schema

The mutation testing report data is expected to be in the format of a the mutation-testing-report-schema. Please view that readme to understand the structure.

For some examples, please see the testResources.

API Reference

src [string]

Default: undefined

Specify a source to load the mutation testing report from. The source is expected to be in JSON format and adhere to the mutation-testing-report-schema.

report [object]

Default: undefined

Specify the mutation testing report directly by binding it to this property. It is expected to adhere to the mutation-testing-report-schema.

titlePostfix [string]

Default: undefined

Specify the postfix to append to the title of the current page. It us reflected as attribute: title-postfix.

Browser compatibility

These elements are built with LitElement, which uses the Web Components set of standards. They are currently supported by all major browsers with the exception of Edge.

For compatibility with older browsers and Edge, load the Web Components polyfills: https://lit-element.polymer-project.org/guide/use#polyfills

FAQs

Package last updated on 15 Mar 2019

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc