semantic-release/test/mocks/child-process.js
Joscha Feth a5cb9ea7f7 fix(gitlog): increase maxBuffer
This is needed for repositories with a lot of commits and/or a big changelog.

Closes #286
2016-09-01 14:35:34 +02:00

25 lines
551 B
JavaScript

const rawCommits = [
'hash-one==SPLIT==commit-one==END==\n',
'hash-two==SPLIT==commit-two==END==\n'
]
module.exports = {
exec: function (command, options, cb) {
if (typeof cb === 'undefined' && typeof options === 'function') {
cb = options
}
if (/contains/.test(command)) {
if (/notinhistory/.test(command)) return cb(new Error())
return cb(null, 'whatever\nmaster\n')
}
cb(
null,
/\.\.HEAD/.test(command)
? rawCommits[0]
: rawCommits.join()
)
},
'@noCallThru': true
}