2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-17 19:21:29 +03:00

style: turn '()=>' into '() =>' (#6324)

Co-authored-by: Jay <jasonsaayman@gmail.com>
This commit is contained in:
Justin Dhillon
2025-11-12 11:49:37 -08:00
committed by GitHub
parent f73474d02c
commit 4d06112452
11 changed files with 29 additions and 29 deletions
+2 -2
View File
@@ -26,12 +26,12 @@ describe('adapters', function () {
it('should detect adapter unavailable status', function () {
adapters.adapters['testadapter'] = null;
assert.throws(()=> adapters.getAdapter('testAdapter'), /is not available in the build/)
assert.throws(() => adapters.getAdapter('testAdapter'), /is not available in the build/)
});
it('should detect adapter unsupported status', function () {
adapters.adapters['testadapter'] = false;
assert.throws(()=> adapters.getAdapter('testAdapter'), /is not supported by the environment/)
assert.throws(() => adapters.getAdapter('testAdapter'), /is not supported by the environment/)
});
it('should pick suitable adapter from the list', function () {
+9 -9
View File
@@ -66,7 +66,7 @@ function toleranceRange(positive, negative) {
const nodeVersion = process.versions.node.split('.').map(v => parseInt(v, 10));
const nodeMajorVersion = nodeVersion[0];
var noop = ()=> {};
var noop = () => {};
describe('supports http with nodejs', function () {
afterEach(async function () {
@@ -541,7 +541,7 @@ describe('supports http with nodejs', function () {
});
});
describe('algorithms', ()=> {
describe('algorithms', () => {
const responseBody ='str';
for (const [typeName, zipped] of Object.entries({
@@ -783,7 +783,7 @@ describe('supports http with nodejs', function () {
// consume the req stream
req.on('data', noop);
// and wait for the end before responding, otherwise an ECONNRESET error will be thrown
req.on('end', ()=> {
req.on('end', () => {
res.end('OK');
});
}).listen(4444, function (err) {
@@ -1844,7 +1844,7 @@ describe('supports http with nodejs', function () {
const dataURI = 'data:application/octet-stream;base64,' + buffer.toString('base64');
axios.get(dataURI).then(({data})=> {
axios.get(dataURI).then(({data}) => {
assert.deepStrictEqual(data, buffer);
done();
}).catch(done);
@@ -1861,7 +1861,7 @@ describe('supports http with nodejs', function () {
const dataURI = 'data:application/octet-stream;base64,' + buffer.toString('base64');
axios.get(dataURI, {responseType: 'blob'}).then(async ({data})=> {
axios.get(dataURI, {responseType: 'blob'}).then(async ({data}) => {
assert.strictEqual(data.type, 'application/octet-stream');
assert.deepStrictEqual(await data.text(), '123');
done();
@@ -1873,7 +1873,7 @@ describe('supports http with nodejs', function () {
const dataURI = 'data:application/octet-stream;base64,' + buffer.toString('base64');
axios.get(dataURI, {responseType: "text"}).then(({data})=> {
axios.get(dataURI, {responseType: "text"}).then(({data}) => {
assert.deepStrictEqual(data, '123');
done();
}).catch(done);
@@ -1884,7 +1884,7 @@ describe('supports http with nodejs', function () {
const dataURI = 'data:application/octet-stream;base64,' + buffer.toString('base64');
axios.get(dataURI, {responseType: "stream"}).then(({data})=> {
axios.get(dataURI, {responseType: "stream"}).then(({data}) => {
var str = '';
data.on('data', function(response){
@@ -2049,7 +2049,7 @@ describe('supports http with nodejs', function () {
maxRedirects: 0
});
samples.slice(skip).forEach(({rate, progress}, i, _samples)=> {
samples.slice(skip).forEach(({rate, progress}, i, _samples) => {
assert.ok(compareValues(rate, configRate),
`Rate sample at index ${i} is out of the expected range (${rate} / ${configRate}) [${
_samples.map(({rate}) => rate).join(', ')
@@ -2097,7 +2097,7 @@ describe('supports http with nodejs', function () {
maxRedirects: 0
});
samples.slice(skip).forEach(({rate, progress}, i, _samples)=> {
samples.slice(skip).forEach(({rate, progress}, i, _samples) => {
assert.ok(compareValues(rate, configRate),
`Rate sample at index ${i} is out of the expected range (${rate} / ${configRate}) [${
_samples.map(({rate}) => rate).join(', ')
+5 -5
View File
@@ -168,12 +168,12 @@ describe('AxiosHeaders', function () {
headers.set('foo', 'bar=value1');
assert.strictEqual(headers.has('foo', (value, header, headers)=> {
assert.strictEqual(headers.has('foo', (value, header, headers) => {
assert.strictEqual(value, 'bar=value1');
assert.strictEqual(header, 'foo');
return true;
}), true);
assert.strictEqual(headers.has('foo', ()=> false), false);
assert.strictEqual(headers.has('foo', () => false), false);
});
it('should support string pattern', function () {
@@ -246,7 +246,7 @@ describe('AxiosHeaders', function () {
headers.set('foo', 'bar=value1');
headers.delete('foo', (value, header)=> {
headers.delete('foo', (value, header) => {
assert.strictEqual(value, 'bar=value1');
assert.strictEqual(header, 'foo');
return false;
@@ -254,7 +254,7 @@ describe('AxiosHeaders', function () {
assert.strictEqual(headers.has('foo'), true);
assert.strictEqual(headers.delete('foo', ()=> true), true);
assert.strictEqual(headers.delete('foo', () => true), true);
assert.strictEqual(headers.has('foo'), false);
});
@@ -277,7 +277,7 @@ describe('AxiosHeaders', function () {
});
});
describe('clear', ()=> {
describe('clear', () => {
it('should clear all headers', () => {
const headers = new AxiosHeaders({x: 1, y:2});