-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: begin to use axios for cloud api requests #31041
base: develop
Are you sure you want to change the base?
Conversation
cypress
|
Project |
cypress
|
Branch Review |
refactor/axios/create-instance
|
Run status |
|
Run duration | 18m 39s |
Commit |
|
Committer | Cacie Prins |
View all properties for this run ↗︎ |
Test results | |
---|---|
|
0
|
|
10
|
|
1232
|
|
0
|
|
32101
|
View all changes introduced in this branch ↗︎ |
Warning
Partial Report: The results for the Application Quality reports may be incomplete.
UI Coverage
46.31%
|
|
---|---|
|
184
|
|
163
|
Accessibility
92.52%
|
|
---|---|
|
3 critical
7 serious
2 moderate
1 minor
|
|
875
|
@@ -4,14 +4,19 @@ import Debug from 'debug' | |||
|
|||
const debug = Debug('cypress-verbose:server:is-retryable-error') | |||
|
|||
export const isRetryableError = (error?: Error) => { | |||
export const isRetryableError = (error: unknown) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potential errors should be considered unknown - subsequent logic performed on them should gate based on runtime type detection. Setting useUnknownInCatchVariables
is considered best practice - and can be checked by typescript-eslint
even in cases of promise .catch
, so it's honored here.
}) | ||
}) | ||
|
||
it('tags errors', function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test is redundant due to the transformError
axios middleware and its unit tests, so it's removed in the move to create_instance_spec.ts
Additional details
As a first step in removing @cypress/request, this shifts the API call to create an instance to Axios.
api/index.ts
fileasyncRetry
util.axios-retry
was considered, but the additional package size and complications regarding overriding behavior for POSTs made it untimely.@packages/server
, but should be considered a TODO if we migrate to vitest.Note: while this request is a POST, and POSTs are not typically retry-able, this endpoint is now idempotent. Retries are enabled in order to improve resiliency to network splits, etc.
Steps to test
How has the user experience changed?
PR Tasks
cypress-documentation
?type definitions
?