coverlet-coverage / coverlet

Cross platform code coverage for .NET
MIT License
2.98k stars 386 forks source link

Wildcard to include async methods #1553

Open geraldwong-instacart opened 10 months ago

geraldwong-instacart commented 10 months ago

I had an issue where async methods weren't being covered. I know async methods cause the compiler to output generated methods for the async state machine. This link has more information: https://github.com/coverlet-coverage/coverlet/issues/1437

My settings file had this: <Include>[*]MyNamespace.MyClass</Include> but in order to include the async methods, I needed to put a wildcard: <Include>[*]MyNamespace.MyClass*</Include>

This workaround is working, however it's not intuitive for most people who don't know that async methods become something else. Also this would include other classes like MyClass1 which I don't want to include.

I'm not sure if there's a solution but just putting it here because it causes problems for people.

github-actions[bot] commented 6 months ago

This issue is stale because it has been open for 3 months with no activity.