@@ -119,6 +119,8 @@ test('test getCollectionById', async () => {
119119 res = await checkErrorResponse ( api , url , method , new errorSDK . codes . ERROR_GET_COLLECTION_BY_ID ( ) , [ 123 ] )
120120 mockResponseWithMethod ( url , method , mock . errors . Internal_Server_Error . err )
121121 res = await checkErrorResponse ( api , url , method , new errorSDK . codes . ERROR_GET_COLLECTION_BY_ID ( ) , [ 123 ] )
122+ mockResponseWithMethod ( url , method , mock . errors . Resource_Not_Found . err )
123+ res = await checkErrorResponse ( api , url , method , new errorSDK . codes . ERROR_GET_COLLECTION_BY_ID ( ) , [ 123 ] )
122124} )
123125
124126test ( 'test getDateRanges' , async ( ) => {
@@ -155,6 +157,8 @@ test('test getDateRangeById', async () => {
155157 // check error responses
156158 mockResponseWithMethod ( url , method , mock . errors . Internal_Server_Error . err )
157159 res = await checkErrorResponse ( api , url , method , new errorSDK . codes . ERROR_GET_DATE_RANGE_BY_ID ( ) , [ 123 ] )
160+ mockResponseWithMethod ( url , method , mock . errors . Resource_Not_Found . err )
161+ res = await checkErrorResponse ( api , url , method , new errorSDK . codes . ERROR_GET_DATE_RANGE_BY_ID ( ) , [ 123 ] )
158162} )
159163
160164test ( 'test getDimensions' , async ( ) => {
@@ -239,6 +243,8 @@ test('test getMetricById', async () => {
239243 // check error responses
240244 mockResponseWithMethod ( url , method , mock . errors . Unauthorized_Request . err )
241245 res = await checkErrorResponse ( api , url , method , new errorSDK . codes . ERROR_GET_METRIC_BY_ID ( ) , [ 111 , 123 ] )
246+ mockResponseWithMethod ( url , method , mock . errors . Resource_Not_Found . err )
247+ res = await checkErrorResponse ( api , url , method , new errorSDK . codes . ERROR_GET_METRIC_BY_ID ( ) , [ 111 , 123 ] )
242248} )
243249
244250test ( 'test getReport' , async ( ) => {
@@ -255,6 +261,8 @@ test('test getReport', async () => {
255261 // check error responses
256262 mockResponseWithMethod ( url , method , mock . errors . Bad_Request . err )
257263 res = await checkErrorResponse ( api , url , method , new errorSDK . codes . ERROR_GET_REPORT ( ) , [ { } ] )
264+ mockResponseWithMethod ( url , method , mock . errors . Invalid_Parameter . err )
265+ res = await checkErrorResponse ( api , url , method , new errorSDK . codes . ERROR_GET_REPORT ( ) , [ { } ] )
258266} )
259267
260268test ( 'test getSegments' , async ( ) => {
@@ -397,6 +405,7 @@ function checkErrorResponse (fn, url, method, error, args = []) {
397405 . catch ( e => {
398406 expect ( e . name ) . toEqual ( error . name )
399407 expect ( e . code ) . toEqual ( error . code )
408+ expect ( e . message ) . not . toContain ( 'response: [Object]' )
400409 resolve ( )
401410 } )
402411 } )
0 commit comments