Socket
Socket
Sign inDemoInstall

jest-stare

Package Overview
Dependencies
Maintainers
1
Versions
84
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-stare

jest html reporter (results processor)


Version published
Weekly downloads
54K
increased by9.7%
Maintainers
1
Weekly downloads
 
Created
Source

Build Status jest npm

Jest HTML Reporter (Results Processor)

This is a Jest HTML reporter (really a "results processor"). Summary test results are parsed into an HTML file for improved readability and filtering.

Sample

Features

It provides:

  • filtering of passed / failed tests
  • side-by-side snapshot diff
  • chart-summarized information
  • api
  • cli

This project is based primarily on:

Usage

jest --testResultsProcessor=jest-stare

Or

"testResultsProcessor": "./node_modules/jest-stare",

After invocation, by default, ./jest-stare will contain:

  • index.html - html report
  • jest-results.json - raw jest json data

Config

Thanks to dogboydog you can configure the default output location of the jest-stare html files in your package.json via:

jest-stare: {
    "resultDir": "results/jest-stare"
}

Additionally, you can configure whether or not jest-stare should log to the console via:

jest-stare: {
    "log": "false"
}

API

You can programmatically invoke jest-stare and provide jest response data via:

const simplePassingTests = require("../__tests__/data/simplePassingTests.json"); // example JSON data
const processor = require("jest-stare");

processor(simplePassingTests, {log: false, resultDir: __dirname + "/output"}); // first parm is jest json results, second is jest-stare config

CLI

You can invoke jest-stare as a CLI after installing globally via npm install -g jest-stare.
Or if jest-stare is a local dependency you can invoke the CLI via npx jest-stare...

Assuming that you have a relative file to your current location in a folder "data" and simplePassingTests.json contains saved JSON output from a jest test invocation, you can run the CLI providing a single positional input jest JSON file:

jest-stare data/simplePassingTests.json

Optionally you can control where the report will be stored using a a second positional:

jest-stare data/simplePassingTests.json c:/users/myId/desktop/output

The command reponse takes a form of:

jest-stare was called with programmatic config
**  jest-stare --testResultsProcessor: wrote output report to c:/users/myId/desktop/output/index.html  **

Development Building / Testing

If you'd like to submit a PR, here are some basic steps to test out code changes. Suggestions and improvements are welcome!

First time setup

  1. git clone this repo
  2. npm install

Try example

  1. npm run build
  2. npx jest

Keywords

FAQs

Package last updated on 26 Feb 2018

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