Skip to content

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

@Ishita-190

Description

@Ishita-190

While reviewing the test coverage, I noticed that the following files have relatively low branch and function coverage:

  • lib/domains/models/Context.js : 28.16% Statements, 16.66% Branches, 14.28% Functions
  • lib/domains/models/Studio.js : 16.8% Statements, 0% Branches, 0% Functions
  • lib/domains/models/Preview.js : 16.98% Statements, 0% Branches, 0% Functions
  • lib/domains/models/SpecificationFile.js : 17.17% Statements, 0% Branches, 0% Functions
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    To Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions