Commit Graph

14 Commits

Author SHA1 Message Date
Jay
fa337332b9
Update unit testing flows as part of migration to vitest (#7484)
* chore: small fixes to tests

* feat: transitional move to vitests

* feat: moving unit tests in progress

* feat: moving more unit tests over

* feat: more tests moved

* feat: updated more sections of the http test

* chore: wip http tests

* chore: wip http tests

* chore: more http tests

* chore: tests

* chore: tests

* chore: tests

* chore: tests

* chore: tests

* chore: tests

* chore: tests

* chore: tests

* chore: tests

* chore: tests

* chore: tests

* chore: tests

* chore: tests

* chore: tests

* chore: tests

* chore: tests

* chore: tests

* chore: tests

* chore: tests

* chore: tests

* chore: tests

* chore: tests

* chore: tests

* chore: tests

* chore: tests

* chore: remove un-needed docs

* chore: update package lock

* chore: update lock
2026-03-06 20:42:14 +02:00
Jay
ef3711d1b3
feat: implement prettier and fix all issues (#7385)
* feat: implement prettier and fix all issues

* fix: failing tests

* fix: implement feedback from codel, ai etc

* chore: dont throw in trim function

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>

* fix: incorrect fix

---------

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
2026-02-14 16:59:48 +02:00
Dmitriy Mozgovoy
bdf493cf8b
Axios ES2017 (#4787)
* Added AxiosHeaders class;

* Fixed README.md href;

* Fixed a potential bug with headers normalization;

* Fixed a potential bug with headers normalization;
Refactored accessor building routine;
Refactored default transforms;
Removed `normalizeHeaderName` helper;

* Added `Content-Length` accessor;
Added missed `has` accessor to TS types;

* Added `AxiosTransformStream` class;
Added progress capturing ability for node.js environment;
Added `maxRate` option to limit the data rate in node.js environment;
Refactored event handled by `onUploadProgress` && `onDownloadProgress` listeners in browser environment;
Added progress & data rate tests for the http adapter;
Added response stream aborting test;
Added a manual progress capture test for the browser;
Updated TS types;
Added TS tests;
Refactored request abort logic for the http adapter;
Added ability to abort the response stream;

* Remove `stream/promises` & `timers/promises` modules usage in tests;

* Use `abortcontroller-polyfill`;

* Fixed AxiosTransformStream dead-lock in legacy node versions;
Fixed CancelError emitting in streams;

* Reworked AxiosTransformStream internal logic to optimize memory consumption;
Added throwing an error if the request stream was silently destroying (without error) Refers to #3966;

* Treat the destruction of the request stream as a cancellation of the request;
Fixed tests;

* Emit `progress` event in the next tick;

* Initial refactoring;

* Refactored Mocha tests to use ESM;

* Refactored Karma tests to use rollup preprocessor & ESM;
Replaced grunt with gulp;
Improved dev scripts;
Added Babel for rollup build;

* Added default commonjs package export for Node build;
Added automatic contributors list generator for package.json;

Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-06-18 11:19:27 +02:00
Dmitriy Mozgovoy
6b9b05b907
Improved FormData support; (#4448)
* Fixed isFormData predicate;
Added support for automatic object serialization to FormData if `Content-Type` is `multipart/form-data`;
Added support for FormData to be overloaded using `config.env.FormData` option;
Added support for FormData in node.js environment through `form-data` package;

* Added the `form-data` package as a dependency for the server build;
Added tests for FormData payload;

* Added FormData automatic serialization section;
Refactored cancellation section;

* Reworked toFormData helper;
Expose toFormData helper as a static method;
Refactored transform request;
Added kindOf, kindOfTest, endsWith, isTypedArray util;
Refactored utils.js to use kindOf for tests;

* Fixed isFormData predicate; (#4413)

Added support for automatic object serialization to FormData if `Content-Type` is `multipart/form-data`;
Added support for FormData to be overloaded using `config.env.FormData` option;
Added support for FormData in node.js environment using `form-data` package;

(cherry picked from commit 73e3bdb883)

* Added shortcut methods `postForm`, `putForm`, `patchForm` to submit a Form;
Added ability to submit FileList object as a FormData;
Updated README.md;

* Updated README.md;
2022-03-14 20:22:10 +02:00
Xianming Zhong
0d69a79c81
Refactor mergeConfig without utils.deepMerge (#2844)
* Adding failing test

* Fixing #2587 default custom config persisting

* Adding Concat keys and filter duplicates

* Fixed value from CPE

* update for review feedbacks

* no deepMerge

* only merge between plain objects

* fix rename

* always merge config by mergeConfig

* extract function mergeDeepProperties

* refactor mergeConfig with all keys, and add special logic for validateStatus

* add test for resetting headers

* add lots of tests and fix a bug

* should not inherit `data`

* use simple toString

* revert #1845

Co-authored-by: David Tanner <david.tanner@lifeomic.com>
Co-authored-by: Justin Beckwith <justin.beckwith@gmail.com>
2020-06-08 20:52:45 +02:00
Angelos Chalaris
1a32ca0601 Remove dependency on is-buffer (#1816)
* Remove dependency on is-buffer from package.json
2019-11-17 22:53:27 -08:00
Felipe Martins
097948698a
Revert "Update Webpack + deps, remove now unnecessary polyfills" (#2479)
* Revert "Update Webpack + deps, remove now unnecessary polyfills (#2410)"

This reverts commit 189b34c45a.

* Fix build (#2496)

* Change syntax to see if build passes

* Test commit

* Test with node 10

* Test adding all browsers in travis

* remove other browsers when running on travis
2019-10-25 11:34:47 -03:00
Avindra Goolcharan
189b34c45a Update Webpack + deps, remove now unnecessary polyfills (#2410)
* Update deps

 * handles webpack 1 -> 4 migration

* remove promise helpers from dev files

assume `Promise` is available, or polyfilled by
the consumer

* Remove isArray util. `isArray` has good coverage, even
   in IE9. So lets remove the custom polyfill.

 https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray

also resolves a few lint issues

* Remove trim util

String.protoype.trim has good coverage (including IE9)

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/Trim

Also, the http adapter already uses the native method.
2019-10-21 15:56:29 -03:00
Rikki Gibson
33747ee8fb Remove usages of isOldIE in tests 2018-08-06 09:56:51 +02:00
Nick Uraltsev
2b8d89a65e Modifying isURLSearchParams function to use instanceof instead of duck typing 2016-05-18 18:47:34 -07:00
Nick Uraltsev
f20490eb6b Adding support for URLSearchParams 2016-05-07 12:26:28 -07:00
Nick Uraltsev
9e7b1b5993 Add isFunction and isStream helpers 2016-04-12 19:49:12 -07:00
Matt Zabriskie
dcbb352262 Moving test helpers and auto-loading them 2016-03-07 13:21:27 -07:00
mzabriskie
fc12b933f7 Moving many nodeunit tests to jasmine 2015-03-18 17:12:51 -06:00