@@ -133,6 +133,45 @@ describe('Uploader Core', () => {
133
133
)
134
134
} )
135
135
136
+ it ( 'Can find a single specified file' , async ( ) => {
137
+ jest . spyOn ( process , 'exit' ) . mockImplementation ( ( ) => { } )
138
+ const log = jest . spyOn ( console , 'log' ) . mockImplementation ( ( ) => { } )
139
+ await app . main ( {
140
+ dryRun : true ,
141
+ file : 'test/fixtures/coverage.txt' ,
142
+ name : 'customname' ,
143
+ token : 'abcdefg' ,
144
+ url : 'https://codecov.io' ,
145
+ } )
146
+ expect ( log ) . toHaveBeenCalledWith (
147
+ expect . stringMatching ( "Processing test/fixtures/coverage.txt..." ) ,
148
+ )
149
+ } )
150
+
151
+ it ( 'Can find multiple specified files' , async ( ) => {
152
+ jest . spyOn ( process , 'exit' ) . mockImplementation ( ( ) => { } )
153
+ const log = jest . spyOn ( console , 'log' ) . mockImplementation ( ( ) => { } )
154
+ await app . main ( {
155
+ dryRun : true ,
156
+ file : [ 'test/fixtures/coverage.txt' , 'test/fixtures/other/coverage.txt' , 'test/does/not/exist.txt' ] ,
157
+ name : 'customname' ,
158
+ token : 'abcdefg' ,
159
+ url : 'https://codecov.io' ,
160
+ } )
161
+ expect ( log ) . toHaveBeenCalledWith (
162
+ expect . stringMatching ( "Processing test/fixtures/coverage.txt..." ) ,
163
+ )
164
+ expect ( log ) . toHaveBeenCalledWith (
165
+ expect . stringMatching ( "Processing test/fixtures/coverage.txt..." ) ,
166
+ )
167
+ expect ( log ) . toHaveBeenCalledWith (
168
+ expect . stringMatching ( "Processing test/does/not/exist.txt..." ) ,
169
+ )
170
+ expect ( log ) . toHaveBeenCalledWith (
171
+ expect . stringContaining ( "Could not read coverage file (test/does/not/exist.txt):" ) ,
172
+ )
173
+ } )
174
+
136
175
it ( 'Can find only coverage from custom dir' , async ( ) => {
137
176
jest . spyOn ( process , 'exit' ) . mockImplementation ( ( ) => { } )
138
177
const log = jest . spyOn ( console , 'log' ) . mockImplementation ( ( ) => { } )
0 commit comments