Skip to content

[test]:Add missing tests for input validation and error wrapping in utilis.js #1955

@SHUBHANSHU602

Description

@SHUBHANSHU602

The utility function parseAsyncAPIDocumentFromFile contains non-trivial control flow that is currently not fully covered by tests, specifically around input validation and error handling.

While the happy path (successful parsing) is exercised indirectly via higher-level tests, two important behaviors remain unverified:

Input validation logic
The function explicitly guards against invalid asyncapiFilepath values (non-string or empty/whitespace strings), but there are no direct tests asserting that these cases throw the expected error.

Error wrapping when parsing fails
When the underlying AsyncAPI parser throws, the function catches the error and rethrows a new error with a normalized message. This wrapping behavior defines part of the public error contract, but it is currently untested.

Image

Affected file :-generator\apps\keeper\src\utils.js

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions