Skip to content

Commit

Permalink
test: Add failing test using same object in both packageFiles & bumpF…
Browse files Browse the repository at this point in the history
…iles
  • Loading branch information
Eemeli Aro committed Jul 23, 2020
1 parent 80301c3 commit 9110044
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -994,6 +994,32 @@ describe('standard-version', function () {
fs.readFileSync('VERSION_TRACKER.txt', 'utf-8').should.equal('6.4.0')
})
})

it('allows same object to be used in packageFiles and bumpFiles', function () {
fs.copyFileSync('../test/mocks/VERSION-6.3.1.txt', 'VERSION_TRACKER.txt')
commit('feat: yet another commit')
const filedesc = {
filename: 'VERSION_TRACKER.txt',
type: 'plain-text'
}
const origWarn = console.warn
console.warn = () => {
throw new Error('console.warn should not be called')
}
return require('./index')({
silent: true,
packageFiles: [filedesc],
bumpFiles: [filedesc]
})
.then(() => {
fs.readFileSync('VERSION_TRACKER.txt', 'utf-8').should.equal('6.4.0')
console.warn = origWarn
})
.catch((error) => {
console.warn = origWarn
throw error
})
})
})

describe('npm-shrinkwrap.json support', function () {
Expand Down

0 comments on commit 9110044

Please sign in to comment.