asyncapi / asyncapi/website

[BUG] :fix implicit 'any' type for 'req' in serve-definitions tests

Open Beginner friendly
#5,073 9 comments 0 reactions 0 assignees View on GitHub
triaged
Dominant language
TypeScript
Stars
716
Forks
1.2k
Avg merge
1d 12h
Merged PRs (30d)
35

Description

### Describe the bug.

In serve-definition.test.ts, the request object used inside mock_fetch callbacks is implicitly inferred as any.
This weakens type safety, hides potential errors, and goes against the project’s TypeScript standards.

### Expected behavior

The req parameter should have an explicit, correct type.

TypeScript should not report any implicit any warnings in test files.

Test code should maintain the same level of type safety as production code.

### Screenshots

Image

### How to Reproduce

Clone the Repo
VISIT;website\netlify\edge-functions\tests\serve-definitions.test.ts
ANALYSE :-
mf.mock("*", (req) => {
console.log(req.url);

if (req.url === metricURL) {
metricCalls++;
}

### 🖥️ Device Information [optional]

- Operating System (OS):WINDOWS 11
- Browser:BRAVE
- Browser Version:

### 👀 Have you checked for similar open issues?

- [x] I checked and didn't find similar issue

### 🏢 Have you read the Contributing Guidelines?

- [x] I have read the [Contributing Guidelines](https://github.com/asyncapi/.github/blob/master/CONTRIBUTING.md)

### Are you willing to work on this issue ?

Yes I am willing to submit a PR!

Contributor guide

Open the contributing guide

Research direction

Open website/netlify/edge-functions/tests/serve-definitions.test.ts and inspect the mf.mock callback and its mock_fetch typing. Confirm the appropriate request type from the surrounding test or API definitions, then run the serve-definitions tests and TypeScript checks; done means req is explicitly typed and no implicit-any warning remains.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
testing
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.