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

@wishtack/jest-tcr

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wishtack/jest-tcr

Jest TCR (Test && Commit || Revert) plugin

  • 0.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
2
Weekly downloads
 
Created
Source

TCR Diagram

Jest-TCR: Test && Commit || Revert for JavaScript

Build Status Greenkeeper badge

What is @wishtack/jest-tcr?

@wishtack/jest-tcr is an implementation of TCR (Test && Commit || Revert) which is an idea from Oddmund Strømme.

In order to reduce code asymmetry by producing the most atomic changes to the code, every time you run the tests, TCR will commit if the tests pass and revert if they fail.

Getting Started

1. Install

with yarn

yarn add -D @wishtack/jest-tcr

with npm

npm install --dev @wishtack/jest-tcr

2. Setup

Create a dedicated jest configuration jest.config.tcr.js next to jest.config.js with the following content:

const config = require('./jest.config');

module.exports = {
  ...config,
  reporters: [
    'default',
    '@wishtack/jest-tcr'
  ]
};

3. Add this script to package.json

{
  ...
  "scripts": {
    "jest:tcr": "jest --config jest.config.tcr.js --onlyChanged"
  },
  ...
}

4. Run Jest in TCR

yarn jest:tcr

or npm run jest:tcr

5. [optional] Relaxed TCR

If you don't want to revert your spec files when tests fail, you can tell @wishtack/jest-tcr not to reset specs using the following configuration:

const config = require('./jest.config');

module.exports = {
  ...config,
  reporters: [
    'default',
    ['@wishtack/jest-tcr', {
      revertBlacklistPattern: /spec\.ts$/
    }]
  ]
};

FAQs

Package last updated on 23 Oct 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