@@ -9,7 +9,7 @@ var rimraf = require('rimraf')
99var vfile = require ( 'to-vfile' )
1010var processor = require ( './processor' ) ( )
1111
12- test ( 'travisDiff ()' , function ( t ) {
12+ test ( 'diff ()' , function ( t ) {
1313 var current = process . cwd ( )
1414 var range = process . env . TRAVIS_COMMIT_RANGE
1515 var stepOne = [
@@ -30,13 +30,13 @@ test('travisDiff()', function(t) {
3030 process . chdir ( path . join ( current , 'test' ) )
3131
3232 trough ( )
33- . use ( function ( ) {
33+ . use ( function ( ) {
3434 return execa ( 'git' , [ 'init' ] )
3535 } )
36- . use ( function ( result , next ) {
36+ . use ( function ( result , next ) {
3737 var file = vfile ( { path : 'example.txt' , contents : stepOne } )
3838
39- processor . process ( file , function ( err ) {
39+ processor . process ( file , function ( err ) {
4040 if ( err ) {
4141 return next ( err )
4242 }
@@ -50,51 +50,51 @@ test('travisDiff()', function(t) {
5050 fs . writeFile ( file . path , file . contents , next )
5151 } )
5252 } )
53- . use ( function ( ) {
53+ . use ( function ( ) {
5454 return execa ( 'git' , [ 'config' , '--global' , 'user.email' ] ) . catch (
55- function ( ) {
55+ function ( ) {
5656 return execa ( 'git' , [
5757 'config' ,
5858 '--global' ,
5959 'user.email' ,
606061- ] ) . then ( function ( ) {
61+ ] ) . then ( function ( ) {
6262 return execa ( 'git' , [ 'config' , '--global' , 'user.name' , 'Ex Ample' ] )
6363 } )
6464 }
6565 )
6666 } )
67- . use ( function ( ) {
67+ . use ( function ( ) {
6868 return execa ( 'git' , [ 'add' , 'example.txt' ] )
6969 } )
70- . use ( function ( ) {
70+ . use ( function ( ) {
7171 return execa ( 'git' , [ 'commit' , '-m' , 'one' ] )
7272 } )
73- . use ( function ( ) {
73+ . use ( function ( ) {
7474 return execa ( 'git' , [ 'rev-parse' , 'HEAD' ] )
7575 } )
76- . use ( function ( result , next ) {
76+ . use ( function ( result , next ) {
7777 var file = vfile ( { path : 'example.txt' , contents : stepTwo } )
7878
7979 initial = result . stdout
8080
8181 fs . writeFile ( file . path , file . contents , next )
8282 } )
83- . use ( function ( ) {
83+ . use ( function ( ) {
8484 return execa ( 'git' , [ 'add' , 'example.txt' ] )
8585 } )
86- . use ( function ( ) {
86+ . use ( function ( ) {
8787 return execa ( 'git' , [ 'commit' , '-m' , 'two' ] )
8888 } )
89- . use ( function ( ) {
89+ . use ( function ( ) {
9090 return execa ( 'git' , [ 'rev-parse' , 'HEAD' ] )
9191 } )
92- . use ( function ( result , next ) {
92+ . use ( function ( result , next ) {
9393 var file = vfile ( { path : 'example.txt' , contents : stepTwo } )
9494
9595 process . env . TRAVIS_COMMIT_RANGE = [ initial , result . stdout ] . join ( '...' )
9696
97- processor . process ( file , function ( err ) {
97+ processor . process ( file , function ( err ) {
9898 t . deepEqual (
9999 file . messages . join ( '' ) ,
100100 'example.txt:5:1-5:6: No lorem!' ,
@@ -104,10 +104,10 @@ test('travisDiff()', function(t) {
104104 next ( err )
105105 } )
106106 } )
107- . use ( function ( result , next ) {
107+ . use ( function ( result , next ) {
108108 var file = vfile ( { path : 'example.txt' , contents : stepTwo } )
109109
110- processor . process ( file , function ( err ) {
110+ processor . process ( file , function ( err ) {
111111 t . deepEqual (
112112 file . messages . join ( '' ) ,
113113 'example.txt:5:1-5:6: No lorem!' ,
@@ -117,37 +117,37 @@ test('travisDiff()', function(t) {
117117 next ( err )
118118 } )
119119 } )
120- . use ( function ( result , next ) {
120+ . use ( function ( result , next ) {
121121 var file = vfile ( { path : 'missing.txt' , contents : other } )
122122
123- processor . process ( file , function ( err ) {
123+ processor . process ( file , function ( err ) {
124124 t . deepEqual ( file . messages , [ ] , 'should ignore unstaged files' )
125125 next ( err )
126126 } )
127127 } )
128- . use ( function ( result , next ) {
128+ . use ( function ( result , next ) {
129129 var file = vfile ( { path : 'new.txt' , contents : other } )
130130 fs . writeFile ( file . path , file . contents , next )
131131 } )
132- . use ( function ( result , next ) {
132+ . use ( function ( result , next ) {
133133 var file = vfile ( { path : 'example.txt' , contents : stepThree } )
134134 fs . writeFile ( file . path , file . contents , next )
135135 } )
136- . use ( function ( ) {
136+ . use ( function ( ) {
137137 return execa ( 'git' , [ 'add' , 'example.txt' , 'new.txt' ] )
138138 } )
139- . use ( function ( ) {
139+ . use ( function ( ) {
140140 return execa ( 'git' , [ 'commit' , '-m' , 'three' ] )
141141 } )
142- . use ( function ( ) {
142+ . use ( function ( ) {
143143 return execa ( 'git' , [ 'rev-parse' , 'HEAD' ] )
144144 } )
145- . use ( function ( result , next ) {
145+ . use ( function ( result , next ) {
146146 var file = vfile ( { path : 'example.txt' , contents : stepTwo } )
147147
148148 process . env . TRAVIS_COMMIT_RANGE = [ initial , result . stdout ] . join ( '...' )
149149
150- processor . process ( file , function ( err ) {
150+ processor . process ( file , function ( err ) {
151151 t . deepEqual (
152152 file . messages . map ( String ) ,
153153 [ 'example.txt:1:1-1:6: No lorem!' , 'example.txt:5:1-5:6: No lorem!' ] ,
@@ -157,10 +157,10 @@ test('travisDiff()', function(t) {
157157 next ( err )
158158 } )
159159 } )
160- . use ( function ( result , next ) {
160+ . use ( function ( result , next ) {
161161 var file = vfile ( { path : 'new.txt' , contents : other } )
162162
163- processor . process ( file , function ( err ) {
163+ processor . process ( file , function ( err ) {
164164 t . deepEqual (
165165 file . messages . join ( '' ) ,
166166 'new.txt:1:1-1:6: No lorem!' ,
@@ -170,19 +170,19 @@ test('travisDiff()', function(t) {
170170 next ( err )
171171 } )
172172 } )
173- . use ( function ( ) {
173+ . use ( function ( ) {
174174 process . env . TRAVIS_COMMIT_RANGE = range
175175 } )
176- . use ( function ( result , next ) {
176+ . use ( function ( result , next ) {
177177 rimraf ( '.git' , next )
178178 } )
179- . use ( function ( result , next ) {
179+ . use ( function ( result , next ) {
180180 rimraf ( 'new.txt' , next )
181181 } )
182- . use ( function ( result , next ) {
182+ . use ( function ( result , next ) {
183183 rimraf ( 'example.txt' , next )
184184 } )
185- . run ( function ( err ) {
185+ . run ( function ( err ) {
186186 t . ifErr ( err , 'should not fail' )
187187 } )
188188} )
0 commit comments