Skip to content

Commit 24547f5

Browse files
authored
Merge branch 'v1.x' into docs/buildurl-encode-comment-7474
2 parents 6d79ade + fa33733 commit 24547f5

File tree

90 files changed

+9959
-3188
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+9959
-3188
lines changed

.github/workflows/run-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
with:
3232
node-version: ${{ matrix.node-version }}
3333
cache: npm
34-
- name: Install dependencies
34+
- name: Install dependencies Node 14
3535
if: matrix.node-version == '14.x'
3636
run: npm i
3737
- name: Install dependencies

package-lock.json

Lines changed: 3747 additions & 3152 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@
4949
"test:node": "npm run test:mocha",
5050
"test:node:coverage": "c8 npm run test:mocha",
5151
"test:browser": "npm run test:karma",
52+
"test:vitest": "vitest run",
53+
"test:vitest:unit": "vitest run --project unit",
54+
"test:vitest:browser": "vitest run --project browser",
55+
"test:vitest:watch": "vitest",
5256
"test:package": "npm run test:eslint && npm run test:exports",
5357
"test:eslint": "node bin/ssl_hotfix.js eslint lib/**/*.js",
5458
"test:mocha": "node bin/ssl_hotfix.js mocha test/unit/**/*.js --timeout 30000 --exit",
@@ -100,6 +104,8 @@
100104
"@rollup/plugin-json": "^4.1.0",
101105
"@rollup/plugin-multi-entry": "^4.1.0",
102106
"@rollup/plugin-node-resolve": "^9.0.0",
107+
"@vitest/browser": "^4.0.18",
108+
"@vitest/browser-playwright": "^4.0.18",
103109
"abortcontroller-polyfill": "^1.7.8",
104110
"auto-changelog": "^2.5.0",
105111
"body-parser": "^1.20.4",
@@ -136,6 +142,7 @@
136142
"mocha": "^10.8.2",
137143
"multer": "^1.4.4",
138144
"pacote": "^20.0.0",
145+
"playwright": "^1.58.2",
139146
"prettier": "^3.8.1",
140147
"pretty-bytes": "^6.1.1",
141148
"rollup": "^2.79.2",
@@ -147,7 +154,8 @@
147154
"stream-throttle": "^0.1.3",
148155
"string-replace-async": "^3.0.2",
149156
"tar-stream": "^3.1.7",
150-
"typescript": "^4.9.5"
157+
"typescript": "^4.9.5",
158+
"vitest": "^4.0.18"
151159
},
152160
"browser": {
153161
"./dist/node/axios.cjs": "./dist/browser/axios.cjs",

rollup.config.js

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -75,21 +75,6 @@ export default async () => {
7575
banner,
7676
},
7777
}),
78-
// browser ESM bundle for CDN with fetch adapter only
79-
// Downsizing from 12.97 kB (gzip) to 12.23 kB (gzip)
80-
/* ...buildConfig({
81-
input: namedInput,
82-
output: {
83-
file: `dist/esm/${outputFileName}-fetch.js`,
84-
format: "esm",
85-
preferConst: true,
86-
exports: "named",
87-
banner
88-
},
89-
alias: [
90-
{ find: './xhr.js', replacement: '../helpers/null.js' }
91-
]
92-
}),*/
9378

9479
// Browser UMD bundle for CDN
9580
...buildConfig({
@@ -118,7 +103,7 @@ export default async () => {
118103
},
119104
}),
120105

121-
// Node.js commonjs bundle
106+
// Node.js commonjs bundle (transpiled for Node 12)
122107
{
123108
input: defaultInput,
124109
output: {
@@ -128,7 +113,15 @@ export default async () => {
128113
exports: 'default',
129114
banner,
130115
},
131-
plugins: [autoExternal(), resolve(), commonjs()],
116+
plugins: [
117+
autoExternal(),
118+
resolve(),
119+
commonjs(),
120+
babel({
121+
babelHelpers: 'bundled',
122+
presets: [['@babel/preset-env', { targets: { node: '12' } }]],
123+
}),
124+
],
132125
},
133126
];
134127
};

test/specs/__helpers.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* eslint-env mocha */
2+
/* global jasmine */
13
import _axios from '../../index.js';
24

35
window.axios = _axios;

test/specs/adapter.spec.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* eslint-env mocha */
2+
/* global jasmine */
13
describe('adapter', function () {
24
beforeEach(function () {
35
jasmine.Ajax.install();

test/specs/api.spec.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-env mocha */
12
describe('static api', function () {
23
it('should have request method helpers', function () {
34
expect(typeof axios.request).toEqual('function');

test/specs/basicAuth.spec.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* eslint-env mocha */
2+
/* global jasmine */
13
import axios from '../../index';
24

35
function validateInvalidCharacterError(error) {

test/specs/cancel.spec.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* eslint-env mocha */
2+
/* global jasmine */
13
const Cancel = axios.Cancel;
24
const CancelToken = axios.CancelToken;
35
import { AbortController as _AbortController } from 'abortcontroller-polyfill/dist/cjs-ponyfill.js';

test/specs/cancel/CancelToken.spec.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-env mocha */
12
import CancelToken from '../../../lib/cancel/CancelToken';
23
import CanceledError from '../../../lib/cancel/CanceledError';
34

0 commit comments

Comments
 (0)