@@ -359,31 +359,29 @@ describe('Tests ajax library', () => {
359359 } ) ;
360360
361361 it ( 'does set withCredentials on the request' , ( done ) => {
362- expect . spyOn ( SecurityUtils , 'isAuthenticationActivated' ) . andReturn ( true ) ;
363- expect . spyOn ( SecurityUtils , 'getAuthenticationRules' ) . andReturn ( authenticationRules ) ;
362+ expect . spyOn ( SecurityUtils , 'isAuthenticationActivated' ) . andReturn ( true ) ;
363+ expect . spyOn ( SecurityUtils , 'getAuthenticationRules' ) . andReturn ( authenticationRules ) ;
364364
365- axios . get ( 'http://www.useBrowserCredentials.com/useBrowserCredentials?parameter1=value1¶meter2=value2' ) . then ( ( ) => {
366- done ( ) ;
367- } ) . catch ( ( exception ) => {
368- console . log ( exception . config ) ;
369- expect ( exception . config ) . toExist ( ) ;
370- expect ( exception . config . withCredentials ) . toExist ( ) ;
371- expect ( exception . config . withCredentials ) . toBeTruthy ( ) ;
372- done ( ) ;
373- } ) ;
365+ axios . get ( 'http://www.useBrowserCredentials.com/useBrowserCredentials?parameter1=value1¶meter2=value2' ) . then ( ( ) => {
366+ done ( ) ;
367+ } ) . catch ( ( exception ) => {
368+ expect ( exception . config ) . toExist ( ) ;
369+ expect ( exception . config . withCredentials ) . toExist ( ) ;
370+ expect ( exception . config . withCredentials ) . toBeTruthy ( ) ;
371+ done ( ) ;
372+ } ) ;
374373 } ) ;
375374
376375 it ( 'does not set withCredentials on the request' , ( done ) => {
377- expect . spyOn ( SecurityUtils , 'isAuthenticationActivated' ) . andReturn ( true ) ;
378- expect . spyOn ( SecurityUtils , 'getAuthenticationRules' ) . andReturn ( authenticationRules ) ;
376+ expect . spyOn ( SecurityUtils , 'isAuthenticationActivated' ) . andReturn ( true ) ;
377+ expect . spyOn ( SecurityUtils , 'getAuthenticationRules' ) . andReturn ( authenticationRules ) ;
379378
380- axios . get ( 'http://www.skipBrowserCredentials.com/geoserver?parameter1=value1¶meter2=value2' ) . then ( ( ) => {
381- done ( ) ;
382- } ) . catch ( ( exception ) => {
383- console . log ( exception . config ) ;
384- expect ( exception . config ) . toExist ( ) ;
385- expect ( exception . config . withCredentials ) . toNotExist ( ) ;
386- done ( ) ;
387- } ) ;
379+ axios . get ( 'http://www.skipBrowserCredentials.com/geoserver?parameter1=value1¶meter2=value2' ) . then ( ( ) => {
380+ done ( ) ;
381+ } ) . catch ( ( exception ) => {
382+ expect ( exception . config ) . toExist ( ) ;
383+ expect ( exception . config . withCredentials ) . toNotExist ( ) ;
384+ done ( ) ;
385+ } ) ;
388386 } ) ;
389387} ) ;
0 commit comments