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

break-check

Package Overview
Dependencies
Maintainers
0
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

break-check

command line tooling to detect breaking changes before you ship them

  • 0.6.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
146
decreased by-4.58%
Maintainers
0
Weekly downloads
 
Created
Source

break-check

command line tooling to detect breaking changes before you ship them

can i use break-check?

break check is a tool for projects where

  1. releases must follow semantic versioning
  2. source code and tests are kept in separate files
  3. new releases are associated to git tags
  4. you can run tests from the command line

if that sounds like your project, read on!

break check introduces the following requirements/model for your project:

  1. public tests can be differentiated from private tests
    • public tests specify the public API of your project
    • public tests, if changed, may indicate that breaking changes are present
    • private tests specify your project's internals and implementation details, perhaps for documentation or coverage purposes
    • private tests, if changed, cannot indicate breaking changes
  2. files containing public tests can be identified by a glob pattern
  3. you must have a command-line command that runs only the public tests in your test suite

example

single-project repository

npx break-check 
  --testPattern="*__public.test.ts" 
  --testCommand="npm run test"

this command will check out all files matching the pattern *__public.test.ts from the last release tag that contains the string my-library, and then run npm run test

if the tests fail, break-check will exit with a non-zero status code, indicating that you have breaking changes in your project at the current commit

multi-project monorepo

npx break-check 
  --tagPattern="my-library" 
  --testPattern="./packages/my-library/__tests__/**/*__public.test.ts" 
  --testCommand="cd packages/my-library && npm run test"

this command will check out all files matching the pattern *__public.test.ts from the last release tag that contains the string my-library, and then run cd packages/my-library && npm run test

if the tests fail, break-check will exit with a non-zero status code, indicating that you have breaking changes in your project at the current commit

options

optionshorthandrequireddescriptionexample
--tagPattern-pString which, if found in a git tag, will be considered a release tag for your library.--tagPattern="my-library"
--testPattern-tGlob pattern to identify files containing public tests.--testPattern="*__public.test.ts"
--testCommand-cCommand to run to run the public tests.--testCommand="npm run test"
--certifyCommand-CCommand to run to certify that breaking changes have been detected.--certifyCommand="grep -q '"my-library": major' $(find ${DIR_PATH}/.changesets -type f) && exit 0 || exit 1"
--baseDirname-bDirectory in which to run the tests and certify the breaking changes.--baseDirname="."

FAQs

Package last updated on 15 Feb 2025

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