generated from actions/javascript-action
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutils.test.js
33 lines (31 loc) · 1.01 KB
/
utils.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
const assert = require('node:assert')
const { isMergeCommitMessage } = require('./utils.js')
describe('isMergeCommitMessage', () => {
describe('returns true for merge commits', () => {
const mergeCommits = [
'Merge branch dev into prd',
'Merge branch \'idHash\' of https://github.com/byu-oit/ces-adm-sv-recommendations into idHash',
'Merge remote-tracking branch \'origin/dev\' into jacobs27',
'Merge pull request #1078 from byu-oit/dev',
'Merge pull request #327',
'Merge branch \'dev\''
]
for (const message of mergeCommits) {
test(message, () => {
assert.equal(isMergeCommitMessage(message), true)
})
}
})
describe('returns false for non-merge commits', () => {
const otherCommits = [
'Add logging to subsystem A',
'fix: typo on page B',
'chore: update dependency C'
]
for (const message of otherCommits) {
test(message, () => {
assert.equal(isMergeCommitMessage(message), false)
})
}
})
})