Skip to content

code coverage calculation: treat switch case statements correctly #21

@johannes-mathes

Description

@johannes-mathes

Bug description

If I have a switch/case statement with falling through, the coverage is not calculated correctly

Steps to reproduce

Define a switch case statement with falling through (intentionallly):

switch (chargingType) {
                case EnumStatusChargingTypeActiveEnum.Type1:
                case EnumStatusChargingTypeActiveEnum.Type2: {
                    this.currentChargingType = ChargingType.A
                    break
                }

write a test case calling the code either within a for loop or even with mentioning Type1 and Type2

Type1 is not marked as covered

Desired behavior

Type1 should be marked as covered, as there is a test for it

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