[Snyk] Upgrade axios-mock-adapter from 1.22.0 to 2.1.0 #81
This check has been archived and is scheduled for deletion.
Learn more about checks retention
GitHub Actions / JEST Tests
succeeded
Jan 16, 2025 in 1s
35 passed, 0 failed and 0 skipped
✅ reports/contentstack-js-core/junit/jest-junit.xml
35 tests were completed in 4s with 35 passed, 0 failed and 0 skipped.
| Test suite | Passed | Failed | Skipped | Time |
|---|---|---|---|---|
| test/contentstack-core.spec.ts | 13✅ | 3s | ||
| test/contentstack-error.spec.ts | 4✅ | 2s | ||
| test/param-serializer.spec.ts | 5✅ | 56ms | ||
| test/request.spec.ts | 3✅ | 258ms | ||
| test/retryPolicy/delivery-sdk-handlers.spec.ts | 10✅ | 3s |
✅ test/contentstack-core.spec.ts
contentstackCore
✅ should return default config when no config is passed
contentstackCore › logHandler
✅ should log an error message when level is "error" and data is provided
✅ should not log anything when level is "error" and no data is provided
✅ should log a message with the provided level and data
contentstackCore › retryCondition
✅ should return true when error response status is 429
✅ should return false when error response status is not 429
✅ should return false when error response is not present
contentstackCore › config.headers
✅ should include apiKey in headers when provided
✅ should include accessToken in headers when provided
✅ should not include apiKey in headers when not provided
✅ should not include accessToken in headers when not provided
contentstackCore › config.onError
✅ should call the onError function when an error occurs
✅ should not call the onError function when no error occurs
✅ test/contentstack-error.spec.ts
Contentstack Error
✅ should throw an error with proper details
✅ should throw an error with a default message if response or config is not present
✅ should throw an error with a default details if response data is not present
✅ should throw an error with proper details when response.data is not available
✅ test/param-serializer.spec.ts
serialize
✅ should return blank string when passed empty params
✅ should return brackets structure when param contains array value
✅ should return non brackets string when param value is not array value
✅ should return query with encode string when passed query param
✅ should return brackets and query with encoded string when passed query param and array value
✅ test/request.spec.ts
Request tests
✅ should fetch successfully data from an API
✅ should handle errors
✅ should throw error when host is required for live preview
✅ test/retryPolicy/delivery-sdk-handlers.spec.ts
retryRequestHandler
✅ should add retryCount to the request config
retryResponseHandler
✅ should return the response as-is
retryResponseErrorHandler
✅ should reject the promise if retryOnError is false
✅ should reject the promise if retryOnError is true
✅ should resolve the promise to 408 error if retryOnError is true and error code is ECONNABORTED
✅ should reject the promise if response status is 429 and retryCount exceeds retryLimit
✅ should reject the promise if response status is 401 and retryCount exceeds retryLimit
✅ should reject the promise if response status is 429 or 401 and retryCount is within limit
✅ should call the retry function if retryCondition is passed
✅ should reject to error when retryCondition is passed but retryLimit is exceeded
Loading