Skip to content
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

[WIP] attempt upgrade to axios 1.x #213

Closed
wants to merge 4 commits into from
Closed

Commits on Nov 24, 2022

  1. build(deps): update axios to 1.2.0

    This also requires new versions of:
    * `typescript` - to support the axios 1.x types
    * `jest` - to support the axios 1.x module
    * `axios-cookiejar-support` for axios 1.x module compatibility
    
    Note: 1.2.0 has fixes to axios request headers that otherwise mean the retry tests fail.
    
    Signed-off-by: Rich Ellis <ricellis@users.noreply.github.com>
    ricellis committed Nov 24, 2022
    Configuration menu
    Copy the full SHA
    03333ff View commit details
    Browse the repository at this point in the history
  2. fix: axios 1.x in request-wrapper

    Use `paramsSerializer` legacy compatibility `serialize` function with existing stringify function.
    Correct axios-cookiejar-support import and intialization.
    Provide backwards compatibility for `jar: true` option.
    
    Correct mocking in request-wrapper.test.js.
    Remove `withCredentials` from cookiejar.test.js.
    Set `synchronous: true` on mock cookie jar.
    Add new test for usage of real tough-cookie CookieJar.
    
    Signed-off-by: Rich Ellis <ricellis@users.noreply.github.com>
    ricellis committed Nov 24, 2022
    Configuration menu
    Copy the full SHA
    1e65a2a View commit details
    Browse the repository at this point in the history
  3. test: correct unhandled error events

    build-request-file-object.test.js and get-content-type.test.js both make use of streams with non-existent paths to check errors. Possibly since upgrading jest these cause suites to fail with e.g.
    ```
    Error: ENOENT: no such file or directory, open '/fake/path/custom-name.env'
    Emitted 'error' event on ReadStream instance at:
        at emitErrorNT (node:internal/streams/destroy:157:8)
        at emitErrorCloseNT (node:internal/streams/destroy:122:3)
        at processTicksAndRejections (node:internal/process/task_queues:83:21) {
      errno: -2,
      code: 'ENOENT',
      syscall: 'open',
      path: '/fake/path/custom-name.env'
    ```
    
    Since the errors are expected for these tests add a no-op handler to handle the error events.
    
    Signed-off-by: Rich Ellis <ricellis@users.noreply.github.com>
    ricellis committed Nov 24, 2022
    Configuration menu
    Copy the full SHA
    f817287 View commit details
    Browse the repository at this point in the history
  4. fix: update minimum Node.js version

    Signed-off-by: Rich Ellis <ricellis@users.noreply.github.com>
    ricellis committed Nov 24, 2022
    Configuration menu
    Copy the full SHA
    db281ed View commit details
    Browse the repository at this point in the history