File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -102,4 +102,32 @@ describe('git-revision-webpack-plugin (unit)', function () {
102
102
expect ( runGitCommand . args [ 0 ] [ 1 ] ) . to . eql ( 'custom branch command' )
103
103
} )
104
104
} )
105
+
106
+ describe ( 'on setting custom last commit date time command' , function ( ) {
107
+ it ( 'should run the build on .apply' , function ( ) {
108
+ var buildFile = sinon . spy ( )
109
+ GitRevisionPlugin . __set__ ( 'buildFile' , buildFile )
110
+
111
+ new GitRevisionPlugin ( {
112
+ lastCommitDateTimeCommand : 'custom last commit date time command'
113
+ } ) . apply ( )
114
+
115
+ var lastCommitDateTimeCall = buildFile . args . find ( function ( calls ) {
116
+ return calls [ 0 ] . asset === 'LASTCOMMITDATETIME'
117
+ } )
118
+
119
+ expect ( lastCommitDateTimeCall [ 0 ] . command ) . to . eql ( 'custom last commit date time command' )
120
+ } )
121
+
122
+ it ( 'should run the custom git command on .lastcommitdatetime' , function ( ) {
123
+ var runGitCommand = sinon . spy ( )
124
+ GitRevisionPlugin . __set__ ( 'runGitCommand' , runGitCommand )
125
+
126
+ new GitRevisionPlugin ( {
127
+ lastCommitDateTimeCommand : 'custom last commit date time command'
128
+ } ) . lastcommitdatetime ( )
129
+
130
+ expect ( runGitCommand . args [ 0 ] [ 1 ] ) . to . eql ( 'custom last commit date time command' )
131
+ } )
132
+ } )
105
133
} )
You can’t perform that action at this time.
0 commit comments