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

danger-plugin-no-test-shortcuts

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

danger-plugin-no-test-shortcuts

Danger plugin to prevent merging test shortcuts (.only and .skip)

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.9K
decreased by-12.07%
Maintainers
1
Weekly downloads
 
Created
Source

danger-plugin-no-test-shortcuts

Build Status npm version semantic-release Greenkeeper badge

Danger plugin to prevent merging test shortcuts (.only and .skip)

Usage

Import and invoke the noTestShortcuts() function in your Dangerfile:

// dangerfile.js
import noTestShortcuts from 'danger-plugin-no-test-shortcuts'

noTestShortcuts({
  testFilePredicate: (filePath) => filePath.endsWith('.test.js'),
})

By default, Danger will fail the build if a new or modified test file contains .only() - this prevents merging changes that will prevent your entire test suite from running on each pull request.

This plugin takes an optional config object with a couple of options:

noTestShortcuts({
  // A required predicate for determining where your test files live.
  testFilePredicate: (filePath) => filePath.endsWith('.test.js'),

  // Defines the behavior for handling skipped tests (e.g. test.skip()).
  // Defaults to 'ignore'.
  // Valid values: 'ignore', 'fail', 'warn'.
  skippedTests: 'fail',

  // Defines any (additional) patterns you want to test for
  // Defaults to no extra patterns
  // Here you can add patterns specific to how your test framework does skips/onlys
  patterns: {
    only: ['customOnly'],
    skip: ['sk.ip']
  }
})

Development

Install Yarn and install the dependencies - yarn install.

Run the tests with yarn test (uses Jest).

This project uses semantic-release for automated NPM package publishing.

The main caveat: instead of running git commit, run yarn commit and follow the prompts to input a conventional changelog message via commitizen.

Keywords

FAQs

Package last updated on 27 Jul 2017

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