asyncapi / asyncapi/studio

feat(tests): Improve unit test coverage for Studio services

Open
#1,246 5 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
213
Forks
143
Avg merge
13h 57m
Merged PRs (30d)
11

Description

I noticed that the test coverage for services is quite limited. Currently, only 4 out of 14 services in `services` have unit tests:

Better test coverage would:
- Make it safer to refactor code without accidentally breaking things
- Help catch bugs before they reach production

The existing tests follow a nice pattern using `createServices()`, so it would be straightforward to add more tests following the same approach

**What changes have to be introduced?**
Add unit test files for the untested services.

**Will this be a breaking change?**
No, this only adds new test files. No changes to existing code or APIs.

Services without tests:
- `parser.service.ts`
- `app.service.ts`
- `specification.service.ts`
- `settings.service.ts`
- `monaco.service.ts`, `preview.service.tsx`, `socket-client.service.tsx`, `server-api.service.ts`

One thing that can also be done here is that to break this issue into multiple prs . If this approach seems valid , i would be happy to complete this issue

Contributor guide

Open the contributing guide

Research direction

Inspect the existing service unit tests and the `createServices()` pattern first, then review the listed untested services: `parser.service.ts`, `app.service.ts`, `specification.service.ts`, `settings.service.ts`, `monaco.service.ts`, `preview.service.tsx`, `socket-client.service.tsx`, and `server-api.service.ts`. Done means adding unit test files for the untested services without changing existing code or APIs, with the test suite passing.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
testing
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.