Skip to content

Comments

Update to Express 5#3

Merged
IvanUkhov merged 1 commit intomainfrom
iu-5
Apr 6, 2025
Merged

Update to Express 5#3
IvanUkhov merged 1 commit intomainfrom
iu-5

Conversation

@IvanUkhov
Copy link
Member

No description provided.

@IvanUkhov IvanUkhov requested a review from Copilot April 6, 2025 07:40
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

Files not reviewed (1)
  • package.json: Language not supported

Comment on lines 31 to 32
async function request(path: string): Promise<express.Response> {
while (true) {
Copy link

Copilot AI Apr 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The infinite loop in the 'request' helper could cause tests to hang indefinitely if the server does not respond. Consider adding a maximum retry count or a timeout mechanism.

Suggested change
async function request(path: string): Promise<express.Response> {
while (true) {
async function request(path: string, maxRetries: number = 5): Promise<express.Response> {
let retries = 0;
while (retries < maxRetries) {

Copilot uses AI. Check for mistakes.
expect(response.status).toBe(500);
});

async function request(path: string): Promise<express.Response> {
Copy link

Copilot AI Apr 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function 'request' is declared to return an 'express.Response', but it actually returns the result of a fetch call (a standard Response). Update the return type to match the actual response type, such as 'Promise'.

Suggested change
async function request(path: string): Promise<express.Response> {
async function request(path: string): Promise<Response> {

Copilot uses AI. Check for mistakes.
@IvanUkhov IvanUkhov merged commit dd05c76 into main Apr 6, 2025
2 checks passed
@IvanUkhov IvanUkhov deleted the iu-5 branch April 6, 2025 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants