sinonjs / sinon

Test spies, stubs and mocks for JavaScript.
https://sinonjs.org/
Other
9.63k stars 770 forks source link

Add dry run mode to `npm version` #2436

Closed cincodenada closed 2 years ago

cincodenada commented 2 years ago

Purpose (TL;DR)

Adds a dry-run mode to our npm version scripts

Background (Problem in detail) - optional

Currently there's no easy way to test npm version commands without actually publishing a release and pushing the updated branches to GitHub, which we obviously don't want to do.

Solution

The post-version script now looks for a DRY_RUN environment variable, which if set, will cause it to skip the following steps in the release process:

How to verify - mandatory

Run DRY_RUN=1 npm version and it should not actually publish a release! You may want to manually edit postversion.sh to disable the npm publish in the non-dry-run path though, just in case things are broken somehow.

Checklist for author

codecov[bot] commented 2 years ago

Codecov Report

Merging #2436 (c6aa2d3) into master (a57bbf6) will not change coverage. The diff coverage is n/a.

:exclamation: Current head c6aa2d3 differs from pull request most recent head 1882051. Consider uploading reports for the commit 1882051 to get more accurate results Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2436   +/-   ##
=======================================
  Coverage   96.01%   96.01%           
=======================================
  Files          41       41           
  Lines        1906     1906           
=======================================
  Hits         1830     1830           
  Misses         76       76           
Flag Coverage Δ
unit 96.01% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update a57bbf6...1882051. Read the comment docs.