Skip to content

Commit 6c7ebab

Browse files
committed
Minor tweaks for ESM strict mode
1 parent 73501b6 commit 6c7ebab

File tree

1 file changed

+23
-19
lines changed

1 file changed

+23
-19
lines changed

benchmark/index.ts

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {URL} from 'node:url';
22
import https from 'node:https';
3-
import axios from 'axios';
3+
/// import axios from 'axios';
44
import Benchmark from 'benchmark';
55
import fetch from 'node-fetch';
66
import request from 'request';
@@ -41,18 +41,18 @@ const fetchOptions = {
4141
agent: httpsAgent,
4242
};
4343

44-
const axiosOptions = {
45-
url: urlString,
46-
httpsAgent,
47-
https: {
48-
rejectUnauthorized: false,
49-
},
50-
};
44+
/// const axiosOptions = {
45+
// url: urlString,
46+
// httpsAgent,
47+
// https: {
48+
// rejectUnauthorized: false,
49+
// },
50+
// };
5151

52-
const axiosStreamOptions: typeof axiosOptions & {responseType: 'stream'} = {
53-
...axiosOptions,
54-
responseType: 'stream',
55-
};
52+
// const axiosStreamOptions: typeof axiosOptions & {responseType: 'stream'} = {
53+
// ...axiosOptions,
54+
// responseType: 'stream',
55+
// };
5656

5757
const httpsOptions = {
5858
https: {
@@ -136,19 +136,23 @@ suite.add('got - promise', {
136136
}).add('axios - promise', {
137137
defer: true,
138138
async fn(deferred: {resolve: () => void}) {
139-
await axios.request(axiosOptions);
139+
// Disabled until it has correct types.
140+
// await axios.request(axiosOptions);
140141
deferred.resolve();
141142
},
142143
}).add('axios - stream', {
143144
defer: true,
144145
async fn(deferred: {resolve: () => void}) {
145-
const result = await axios.request(axiosStreamOptions);
146-
const {data}: any = result;
146+
// Disabled until it has correct types.
147+
// const result = await axios.request(axiosStreamOptions);
148+
// const {data}: any = result;
147149

148-
data.resume();
149-
data.once('end', () => {
150-
deferred.resolve();
151-
});
150+
// data.resume();
151+
// data.once('end', () => {
152+
// deferred.resolve();
153+
// });
154+
155+
deferred.resolve();
152156
},
153157
}).add('https - stream', {
154158
defer: true,

0 commit comments

Comments
 (0)