push
github
1157 of 1216 branches covered (95.15%)
4856 of 5126 relevant lines covered (94.73%)
42789.8 hits per line
1 |
'use strict'
|
|
2 |
|
4✔ |
3 |
const parserOpts = require('./parser-opts')
|
4✔ |
4 |
|
4✔ |
5 |
module.exports = { |
4✔ |
6 |
parserOpts, |
4✔ |
7 |
|
4✔ |
8 |
whatBump: (commits) => {
|
4✔ |
9 |
let level = 2
|
× |
10 |
let breakings = 0
|
× |
11 |
let features = 0
|
× |
12 |
|
× |
13 |
commits.forEach(commit => { |
× |
14 |
if (commit.notes.length > 0) { |
× |
15 |
breakings += commit.notes.length |
× |
16 |
level = 0
|
× |
17 |
} else if (commit.type === 'feat') { |
× |
18 |
features += 1
|
× |
19 |
if (level === 2) { |
× |
20 |
level = 1
|
× |
21 |
} |
× |
22 |
} |
× |
23 |
}) |
× |
24 |
|
× |
25 |
return {
|
× |
26 |
level: level,
|
× |
27 |
reason: `There are ${breakings} BREAKING CHANGES and ${features} features` |
× |
28 |
} |
× |
29 |
} |
× |
30 |
} |
4✔ |