Skip to content

Code coverage calculation: Skip type definitions (e.g. Interface). #20

@johannes-mathes

Description

@johannes-mathes

Bug description

When I define an interface in assembly script and I test the class implementing the interface, sometimes the code is marked as "covered", but sometimes not.

Steps to reproduce

define an interface in assembly script, write an implementing class. write a unit test with the assemblyscript framework.

  • Without the test code doing a cast, the interface will be marked as uncovered
  • If there is only one implementing class (no poliymorphism) and a cast, the typical compiler setting will optimize it -> marked as uncovered
  • If there are more implementing classes and a cast, it is marked as covered

Desired behavior

According to industry best practices, the unit test framework should do:

Executable Code -> consider:

  • Class methods, Functions
  • Control structures (e.g., if, for, while)
  • Expressions and statements

Not included:

  • Interfaces
  • Type definitions (type, interface)
  • Comments
  • Declarations without logic (e.g., const, let without initialization)

Metadata

Metadata

Assignees

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