Skip to content

Syntax aware coverage ignore directives #26722

Open
@bcheidemann

Description

Relates to #16626

In addition to "// deno-coverage-ignore-[file|next|start|stop]" it would be useful to implement "syntax aware" directives.

In the first instance, I would propose the following two directives be added, which I believe would be commonly used.

  1. "// deno-coverage-ignore-branch" for ignoring specific branches, primarily of an if or switch statement. A motivating example would be to ignore unreachable branches which are used for static never type assertions.
  2. "// deno-coverage-ignore-construct" (open to naming suggestions) which would ignore the next syntactic construct, such as an entire function declaration, loop, if/else if/else statement, etc. A motivating example for this would be to ignore the internals of a debug logging utility function.

Both of these can be replaced with "// deno-coverage-ignore-[start|stop]" but would be easier to code review and more convenient as "syntax aware" directives.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    suggestionsuggestions for new features (yet to be agreed)testingrelated to deno test and coverage

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions