New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

jest-label

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-label

A labeling utility for jest tests

1.0.0
latest
Source
npm
Version published
Maintainers
1
Created
Source

Jest Label

Jest labels allows you to label and categorize Jest tests. The utility can be coupled with jest-xunit to produce test results with traits.

Installation

npm i -D jest-label

In your jest config add the following:

{
  ...
  setupFiles: [ 'jest-label/setup' ],
  ...
}

The plugin includes default traits and types:

const types = global.types || { INTEGRATION: 'Integration', UNIT: 'Unit' };
const traits = global.traits || { SLOW: 'Slow' };

If you would like to override these traits and types with your own traits and types simply add another setupFile and define these as globals.

Using Jest Label

describe(label({ name: 'my test name', type: types.UNIT, traits: traits.SLOW }), () => { ... });

You can use label in describe or test/it. Type is required. Traits are optional can either be a string or an array of traits. The above will produce the following label:

(Test Type: Integration, Test Traits: Slow) my test name

Keywords

jest plugin

FAQs

Package last updated on 12 Nov 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