Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function mockNoCommits() {
gitRawCommits.mockReset()
gitRawCommits.mockImplementationOnce(() => {
const stream = require('stream')
const readable = new stream.Readable()
readable.push(null)
readable.emit('close')
return readable
})
}
function mockGroup(commits) {
gitRawCommits.mockImplementationOnce(() => {
const stream = require('stream')
const readable = new stream.Readable()
commits.forEach(commit => {
const {
hash, author, date, subject, body,
} = commit
readable.push(`\n${hash}\n${author}\n${date}\n${subject}\n${body}\n`)
})
readable.push(null)
readable.emit('close')
return readable
})
}