From d63e86e18f61b32cf3142ddd5bfa59a3d816479e Mon Sep 17 00:00:00 2001 From: Joe Bottigliero Date: Sat, 24 Aug 2019 08:35:27 -0500 Subject: [PATCH] test: adds a test for packageFiles --- test.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/test.js b/test.js index d5c89d4e3..76e7d88c1 100644 --- a/test.js +++ b/test.js @@ -965,6 +965,31 @@ describe('standard-version', function () { }) }) + describe('custom `packageFiles` support', function () { + it('reads and writes to a custom `plain-text` file', function () { + fs.copyFileSync('../test/mocks/VERSION-6.3.1.txt', 'VERSION_TRACKER.txt') + commit('feat: yet another commit') + return require('./index')({ + silent: true, + packageFiles: [ + { + filename: 'VERSION_TRACKER.txt', + type: 'plain-text' + } + ], + bumpFiles: [ + { + filename: 'VERSION_TRACKER.txt', + type: 'plain-text' + } + ] + }) + .then(() => { + fs.readFileSync('VERSION_TRACKER.txt', 'utf-8').should.equal('6.4.0') + }) + }) + }) + describe('npm-shrinkwrap.json support', function () { beforeEach(function () { writeNpmShrinkwrapJson('1.0.0')