Skip to content

Mocking a class with @Deprecated methods should include the same Deprecation warningsΒ #677

Open
@tony-ditchlabs

Description

@tony-ditchlabs

When a class with fields or methods marked as @Deprecated("someMessage") are Mocked, the @Deprecated is stripped away from the resulting Mock class.

It's very helpful for Dart Analysis to point out deprecated code with warnings, but with Mocked classes, the warnings all disappear - methods that are or aren't deprecated are indistinguishable from each other. Updating tests becomes quite the chore.

It would be helpful to include a way to toggle including / excluding @Deprecated annotations when generating Mocks, though to prevent a breaking change, I suspect it would have to be set to false by default.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3A lower priority bug or feature requesttype-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions