@@ -2,27 +2,27 @@ const Github = require('../github');
22
33describe ( 'Github Resource' , ( ) => {
44 const fakeRequest = {
5- get : jest . fn ( )
5+ get : jest . fn ( ) ,
66 } ;
77 const githubResource = new Github ( fakeRequest ) ;
88 afterEach ( ( ) => jest . clearAllMocks ( ) ) ;
99
10- it ( 'should return the followers count for a given github user' , async ( ) => {
11- fakeRequest . get . mockResolvedValueOnce ( { data : { followers : 120 } } ) ;
10+ it ( 'should return the followers count for a given github user' , async ( ) => {
11+ fakeRequest . get . mockResolvedValueOnce ( { data : { followers : 120 } } ) ;
1212
1313 const response = await githubResource . getFollowerCount ( 'waldemarnt' ) ;
14- expect ( response ) . toEqual ( { followers :120 } ) ;
14+ expect ( response ) . toEqual ( { followers : 120 } ) ;
1515 } ) ;
16- it ( 'should return not found when the user doenst exist' , async ( ) => {
17- fakeRequest . get . mockRejectedValueOnce ( { response : { data : 'Not Found' , status : 404 } } ) ;
16+ it ( 'should return not found when the user doenst exist' , async ( ) => {
17+ fakeRequest . get . mockRejectedValueOnce ( { response : { data : 'Not Found' , status : 404 } } ) ;
1818
1919 const response = await githubResource . getFollowerCount ( 'odkasodksaodk' ) ;
20- expect ( response ) . toEqual ( { error : 'Not Found' } ) ;
20+ expect ( response ) . toEqual ( { error : 'Not Found' } ) ;
2121 } ) ;
22- it ( 'should return error when a general error happens' , async ( ) => {
23- fakeRequest . get . mockRejectedValueOnce ( { response : { data : 'Error' , status : 500 } } ) ;
22+ it ( 'should return error when a general error happens' , async ( ) => {
23+ fakeRequest . get . mockRejectedValueOnce ( { response : { data : 'Error' , status : 500 } } ) ;
2424
2525 const response = await githubResource . getFollowerCount ( 'waldemarnt' ) ;
26- expect ( response ) . toEqual ( { error : 'Error' } ) ;
26+ expect ( response ) . toEqual ( { error : 'Error' } ) ;
2727 } ) ;
2828} ) ;
0 commit comments