@@ -240,7 +240,7 @@ describe("Test fetchStats", () => {
240
240
it ( "should fetch two pages of stars if 'FETCH_MULTI_PAGE_STARS' env variable is set to `true`" , async ( ) => {
241
241
process . env . FETCH_MULTI_PAGE_STARS = true ;
242
242
243
- let stats = await fetchStats ( "anuraghazra" ) ;
243
+ let stats = await fetchStats ( "anuraghazra" , [ ] ) ;
244
244
const rank = calculateRank ( {
245
245
totalCommits : 100 ,
246
246
totalRepos : 5 ,
@@ -265,7 +265,15 @@ describe("Test fetchStats", () => {
265
265
it ( "should fetch one page of stars if 'FETCH_MULTI_PAGE_STARS' env variable is set to `false`" , async ( ) => {
266
266
process . env . FETCH_MULTI_PAGE_STARS = "false" ;
267
267
268
- let stats = await fetchStats ( "anuraghazra" ) ;
268
+ await expect ( fetchStats ( "anuraghazra" , [ ] ) ) . rejects . toThrow (
269
+ "Could not resolve to a User with the login of 'noname'." ,
270
+ ) ;
271
+ } ) ;
272
+
273
+ it ( "should fetch and add private contributions" , async ( ) => {
274
+ mock . onPost ( "https://api.github.com/graphql" ) . reply ( 200 , data ) ;
275
+
276
+ let stats = await fetchStats ( "anuraghazra" , [ ] , true ) ;
269
277
const rank = calculateRank ( {
270
278
totalCommits : 100 ,
271
279
totalRepos : 5 ,
@@ -290,7 +298,7 @@ describe("Test fetchStats", () => {
290
298
it ( "should fetch one page of stars if 'FETCH_MULTI_PAGE_STARS' env variable is not set" , async ( ) => {
291
299
process . env . FETCH_MULTI_PAGE_STARS = undefined ;
292
300
293
- let stats = await fetchStats ( "anuraghazra" ) ;
301
+ let stats = await fetchStats ( "anuraghazra" , [ ] , true , true ) ;
294
302
const rank = calculateRank ( {
295
303
totalCommits : 100 ,
296
304
totalRepos : 5 ,
0 commit comments