refactor(commits,type): simplify interfaces
This commit is contained in:
+11
-17
@@ -6,14 +6,11 @@ test('get type from commits', (t) => {
|
||||
t.test('get type from plugin', (t) => {
|
||||
type({
|
||||
analyze: () => 'major'
|
||||
}, {
|
||||
commits: [{
|
||||
hash: '0',
|
||||
message: 'a'
|
||||
}],
|
||||
lastRelease: {
|
||||
version: '1.0.0'
|
||||
}
|
||||
}, [{
|
||||
hash: '0',
|
||||
message: 'a'
|
||||
}], {
|
||||
version: '1.0.0'
|
||||
}, (err, type) => {
|
||||
t.error(err)
|
||||
t.is(type, 'major')
|
||||
@@ -23,20 +20,17 @@ test('get type from commits', (t) => {
|
||||
t.test('error when no changes', (t) => {
|
||||
type({
|
||||
analyze: () => null
|
||||
}, {
|
||||
commits: [],
|
||||
lastRelease: {}
|
||||
}, (err) => {
|
||||
}, [], {},
|
||||
(err) => {
|
||||
t.is(err.code, 'ENOCHANGE')
|
||||
})
|
||||
})
|
||||
|
||||
t.test('initial version', (t) => {
|
||||
type({}, {
|
||||
lastRelease: {
|
||||
version: null
|
||||
}
|
||||
}, (err, type) => {
|
||||
type({
|
||||
analyze: () => 'major'
|
||||
}, [], {},
|
||||
(err, type) => {
|
||||
t.error(err)
|
||||
t.is(type, 'initial')
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user