1
+ import { promiseError } from '@kwsites/promise-result' ;
1
2
import {
2
3
assertExecutedCommands ,
3
4
assertGitError ,
@@ -11,7 +12,6 @@ import {
11
12
} from './__fixtures__' ;
12
13
import { SimpleGit , TaskConfigurationError } from '../..' ;
13
14
import { parseCommitResult } from '../../src/lib/parsers/parse-commit' ;
14
- import { promiseError } from '@kwsites/promise-result' ;
15
15
16
16
describe ( 'commit' , ( ) => {
17
17
let git : SimpleGit ;
@@ -26,62 +26,62 @@ describe('commit', () => {
26
26
it ( 'empty commit' , async ( ) => {
27
27
git . commit ( [ ] , { '--amend' : null , '--no-edit' : null } ) ;
28
28
await closeWithSuccess ( ) ;
29
- assertExecutedCommands ( 'commit' , '--amend' , '--no-edit' ) ;
29
+ assertExecutedCommands ( '-c' , 'core.abbrev=40' , ' commit', '--amend' , '--no-edit' ) ;
30
30
} ) ;
31
31
32
32
it ( 'single message, no files, no options and callback' , async ( ) => {
33
33
const task = git . commit ( 'message' , callback ) ;
34
34
await closeWithSuccess ( ) ;
35
- assertExecutedCommands ( 'commit' , '-m' , 'message' ) ;
35
+ assertExecutedCommands ( '-c' , 'core.abbrev=40' , ' commit', '-m' , 'message' ) ;
36
36
expect ( callback ) . toHaveBeenCalledWith ( null , await task ) ;
37
37
} ) ;
38
38
39
39
it ( 'multi message, no files, no options and callback' , async ( ) => {
40
40
const task = git . commit ( [ 'aaa' , 'bbb' ] , callback ) ;
41
41
await closeWithSuccess ( ) ;
42
- assertExecutedCommands ( 'commit' , '-m' , 'aaa' , '-m' , 'bbb' ) ;
42
+ assertExecutedCommands ( '-c' , 'core.abbrev=40' , ' commit', '-m' , 'aaa' , '-m' , 'bbb' ) ;
43
43
expect ( callback ) . toHaveBeenCalledWith ( null , await task ) ;
44
44
} ) ;
45
45
46
46
it ( 'single message, no files, with options object and callback' , async ( ) => {
47
47
const task = git . commit ( 'message' , { '--opt' : null } , callback ) ;
48
48
await closeWithSuccess ( ) ;
49
- assertExecutedCommands ( 'commit' , '-m' , 'message' , '--opt' ) ;
49
+ assertExecutedCommands ( '-c' , 'core.abbrev=40' , ' commit', '-m' , 'message' , '--opt' ) ;
50
50
expect ( callback ) . toHaveBeenCalledWith ( null , await task ) ;
51
51
} ) ;
52
52
53
53
it ( 'single message, single file, options object and callback' , async ( ) => {
54
54
const task = git . commit ( 'msg' , 'aaa.txt' , { '--opt' : null } , callback ) ;
55
55
await closeWithSuccess ( ) ;
56
- assertExecutedCommands ( 'commit' , '-m' , 'msg' , 'aaa.txt' , '--opt' ) ;
56
+ assertExecutedCommands ( '-c' , 'core.abbrev=40' , ' commit', '-m' , 'msg' , 'aaa.txt' , '--opt' ) ;
57
57
expect ( callback ) . toHaveBeenCalledWith ( null , await task ) ;
58
58
} ) ;
59
59
60
60
it ( 'single message, single file, no options with callback' , async ( ) => {
61
61
const task = git . commit ( 'msg' , 'aaa.txt' , callback ) ;
62
62
await closeWithSuccess ( ) ;
63
- assertExecutedCommands ( 'commit' , '-m' , 'msg' , 'aaa.txt' , ) ;
63
+ assertExecutedCommands ( '-c' , 'core.abbrev=40' , ' commit', '-m' , 'msg' , 'aaa.txt' , ) ;
64
64
expect ( callback ) . toHaveBeenCalledWith ( null , await task ) ;
65
65
} ) ;
66
66
67
67
it ( 'multi message, single file, no options with callback' , async ( ) => {
68
68
const task = git . commit ( [ 'aaa' , 'bbb' ] , 'aaa.txt' , callback ) ;
69
69
await closeWithSuccess ( ) ;
70
- assertExecutedCommands ( 'commit' , '-m' , 'aaa' , '-m' , 'bbb' , 'aaa.txt' ) ;
70
+ assertExecutedCommands ( '-c' , 'core.abbrev=40' , ' commit', '-m' , 'aaa' , '-m' , 'bbb' , 'aaa.txt' ) ;
71
71
expect ( callback ) . toHaveBeenCalledWith ( null , await task ) ;
72
72
} ) ;
73
73
74
74
it ( 'multi message, multi file, no options with callback' , async ( ) => {
75
75
const task = git . commit ( [ 'aaa' , 'bbb' ] , [ 'a.txt' , 'b.txt' ] , callback ) ;
76
76
await closeWithSuccess ( ) ;
77
- assertExecutedCommands ( 'commit' , '-m' , 'aaa' , '-m' , 'bbb' , 'a.txt' , 'b.txt' ) ;
77
+ assertExecutedCommands ( '-c' , 'core.abbrev=40' , ' commit', '-m' , 'aaa' , '-m' , 'bbb' , 'a.txt' , 'b.txt' ) ;
78
78
expect ( callback ) . toHaveBeenCalledWith ( null , await task ) ;
79
79
} ) ;
80
80
81
81
it ( 'multi message, multi file, options object with callback' , async ( ) => {
82
82
const task = git . commit ( [ 'aaa' , 'bbb' ] , [ 'a.txt' , 'b.txt' ] , { '--foo' : null } , callback ) ;
83
83
await closeWithSuccess ( ) ;
84
- assertExecutedCommands ( 'commit' , '-m' , 'aaa' , '-m' , 'bbb' , 'a.txt' , 'b.txt' , '--foo' ) ;
84
+ assertExecutedCommands ( '-c' , 'core.abbrev=40' , ' commit', '-m' , 'aaa' , '-m' , 'bbb' , 'a.txt' , 'b.txt' , '--foo' ) ;
85
85
expect ( callback ) . toHaveBeenCalledWith ( null , await task ) ;
86
86
} ) ;
87
87
@@ -158,7 +158,7 @@ describe('commit', () => {
158
158
branch : 'alpha' ,
159
159
root : false
160
160
} ) ) ;
161
- } )
161
+ } ) ;
162
162
163
163
} ) ;
164
164
0 commit comments