
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
danger-plugin-no-test-shortcuts
Advanced tools
Danger plugin to prevent merging test shortcuts (.only and .skip)
Danger plugin to prevent merging test shortcuts (.only and .skip)
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']
}
})
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.
FAQs
Danger plugin to prevent merging test shortcuts (.only and .skip)
The npm package danger-plugin-no-test-shortcuts receives a total of 1,877 weekly downloads. As such, danger-plugin-no-test-shortcuts popularity was classified as popular.
We found that danger-plugin-no-test-shortcuts demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.