I recently discovered the npm version [major|minor|patch] command to automatically bump the package version number and commit the changes. This was a magical little discovery.
Is it possible to run tests prior to the bump & git commit with npm? Trying to avoid having to write a bash script.
I can't find anything on google or stack search "npm version ....." matches too many unrelated results. And there is no info about testing in the docs npm-version
I was begging to write a script before this discovery. To test, bump version, then git commit.
I'm using karma, package.json contains
"scripts": {
"test": "karma run"
}
While testing the npm version command I added a failing test
it("force fail",function(){
expect(true).toEqual(1);
});
So karma run and npm test both result in a failed test run. I was hoping this would stop the version patch, but no luck. I managed to bump and commit with failing tests.