asyncapi / asyncapi/cli

[TEST] : low coverage in lib/domains/models

Open
#2,016 4 comments 0 reactions 0 assignees View on GitHub
stale
Dominant language
TypeScript
Stars
272
Forks
375
Avg merge
3h 22m
Merged PRs (30d)
8

Description

The following files have relatively low branch and function coverage:

Image

A lot of helper methods and error-handling branches are currently not exercised by the existing test suite:

- Context.js: validation helpers, duplicate/empty context checks, and error paths in methods like `loadContext` , `addContext` , `removeContext` , and `setCurrentContext` .
- Studio.js: early returns in `start()`, path validation logic (`isValidFilePath`), and branches in file read/write helpers.

Improving coverage here would strengthen confidence in edge cases and reduce the risk of regressions.

### Steps to Reproduce:
- `npx nyc npm test`
- `npx nyc report --reporter=html`
- `start coverage/index.html`
- In the report, navigate to `lib/domains/models`
- Navigate to `Context.js`, `Studio.js`, `Preview.js`, `SpecificationFile.js`

Happy to raise a PR for this if the maintainers approve

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.