Skip to content

Commit

Permalink
fix(MockAgent): add explicit return types to agent methods (#696)
Browse files Browse the repository at this point in the history
  • Loading branch information
sam-super authored Jan 2, 2025
1 parent 3ed95f9 commit 6400beb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/interceptors/ClientRequest/agents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class MockAgent extends http.Agent {
this.onResponse = options.onResponse
}

public createConnection(options: any, callback: any) {
public createConnection(options: any, callback: any): net.Socket {
const createConnection =
(this.customAgent instanceof http.Agent &&
this.customAgent.createConnection) ||
Expand Down Expand Up @@ -64,7 +64,7 @@ export class MockHttpsAgent extends https.Agent {
this.onResponse = options.onResponse
}

public createConnection(options: any, callback: any) {
public createConnection(options: any, callback: any): net.Socket {
const createConnection =
(this.customAgent instanceof https.Agent &&
this.customAgent.createConnection) ||
Expand Down
2 changes: 1 addition & 1 deletion src/interceptors/XMLHttpRequest/utils/createEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export function createEvent(
target: XMLHttpRequest | XMLHttpRequestUpload,
type: string,
init?: ProgressEventInit
): EventPolyfill {
): EventPolyfill | ProgressEvent {
const progressEvents = [
'error',
'progress',
Expand Down

0 comments on commit 6400beb

Please sign in to comment.