Skip to content

Commit

Permalink
rerun lint
Browse files Browse the repository at this point in the history
  • Loading branch information
sofisl committed Feb 15, 2025
1 parent b7505ff commit 67d0aa8
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions src/TeenyStatistics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export class TeenyStatistics {
this._options.concurrentRequests +
'. Use the TEENY_REQUEST_WARN_CONCURRENT_REQUESTS environment ' +
'variable or the concurrentRequests option of teeny-request to ' +
'increase or disable (0) this warning.'
'increase or disable (0) this warning.',
);
warning.type = TeenyStatisticsWarning.CONCURRENT_REQUESTS;
warning.value = this._concurrentRequests;
Expand Down Expand Up @@ -187,7 +187,7 @@ export class TeenyStatistics {
let concurrentRequests = this.DEFAULT_WARN_CONCURRENT_REQUESTS;

const envConcurrentRequests = Number(
process.env.TEENY_REQUEST_WARN_CONCURRENT_REQUESTS
process.env.TEENY_REQUEST_WARN_CONCURRENT_REQUESTS,
);
if (diConcurrentRequests !== undefined) {
concurrentRequests = diConcurrentRequests;
Expand Down
2 changes: 1 addition & 1 deletion src/agents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function shouldUseProxyForURI(uri: string): boolean {
*/
export function getAgent(
uri: string,
reqOpts: Options
reqOpts: Options,
): HttpAnyAgent | undefined {
const isHttp = uri.startsWith('http://');
const proxy =
Expand Down
22 changes: 11 additions & 11 deletions test/TeenyStatistics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe('TeenyStatistics', () => {
it('should have default concurrent requests', () => {
assert.strictEqual(
TeenyStatistics.DEFAULT_WARN_CONCURRENT_REQUESTS,
5000
5000,
);
});

Expand Down Expand Up @@ -231,8 +231,8 @@ describe('TeenyStatistics', () => {
t.requestStarting();
assert(
emitWarnStub.calledOnceWith(
sinon.match.instanceOf(TeenyStatisticsWarning)
)
sinon.match.instanceOf(TeenyStatisticsWarning),
),
);
});

Expand All @@ -246,8 +246,8 @@ describe('TeenyStatistics', () => {
t.requestStarting();
assert(
emitWarnStub.calledOnceWith(
sinon.match.instanceOf(TeenyStatisticsWarning)
)
sinon.match.instanceOf(TeenyStatisticsWarning),
),
);

// shouldn't emit on the next call (i.e. still greater than threshold)
Expand All @@ -271,8 +271,8 @@ describe('TeenyStatistics', () => {
t.requestStarting();
assert(
emitWarnStub.calledOnceWith(
sinon.match.instanceOf(TeenyStatisticsWarning)
)
sinon.match.instanceOf(TeenyStatisticsWarning),
),
);

// let's bring the counter back down
Expand All @@ -298,7 +298,7 @@ describe('TeenyStatistics', () => {
assert.strictEqual(warning.value, 5e3);
assert.strictEqual(
warning.type,
TeenyStatisticsWarning.CONCURRENT_REQUESTS
TeenyStatisticsWarning.CONCURRENT_REQUESTS,
);
});

Expand All @@ -311,15 +311,15 @@ describe('TeenyStatistics', () => {
const errStr: string = emitWarnStub.firstCall.args[0].toString();
assert(
errStr.includes('Possible excessive concurrent requests detected.'),
'describes the nature of the warning'
'describes the nature of the warning',
);
assert(
errStr.includes('TEENY_REQUEST_WARN_CONCURRENT_REQUESTS'),
'mentions env var'
'mentions env var',
);
assert(
errStr.includes('concurrentRequests'),
'mentions concurrentRequests option'
'mentions concurrentRequests option',
);
assert(errStr.search(/\b0\b/) !== -1, 'mentions 0');
});
Expand Down
8 changes: 4 additions & 4 deletions test/agents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ describe('agents', () => {
maxSockets: 1000,
},
},
defaultOptions
defaultOptions,
);
const agent = getAgent(uri, options);
assert.strictEqual(agent!.maxSockets, 1000);
Expand All @@ -224,7 +224,7 @@ describe('agents', () => {
maxSockets: 1000,
},
},
defaultOptions
defaultOptions,
);
const agent = getAgent(uri, options);
assert.strictEqual(agent, undefined);
Expand All @@ -243,7 +243,7 @@ describe('agents', () => {
maxSockets: 1000,
},
},
defaultOptions
defaultOptions,
);
const agent = getAgent(uri, options);
assert.strictEqual(agent!.maxSockets, 1000);
Expand All @@ -256,7 +256,7 @@ describe('agents', () => {
maxSockets: 1000,
},
},
defaultOptions
defaultOptions,
);
const agent = getAgent(uri, options);
assert.strictEqual(agent, undefined);
Expand Down

0 comments on commit 67d0aa8

Please sign in to comment.