Skip to content

auto detect getters/setters just like methods #74

@chris-kruining

Description

@chris-kruining

Hi I ran into the issue where I have a getter on my component that returns an observable, but getters are not automatically picked up like methods are. So I was wondering if it would be doable to also add auto detection for getters. I also state setters in the title just to be sure, but I cannot imagine why you would need to incept a setter.

I am also wondering if https://github.com/hirezio/auto-spies/blob/e433d8d3d012c8c38dfec53b13487214b47322fa/packages/auto-spies-core/src/create-auto-spy-from-class.ts#L95C1-L104C2 is possibly bugged, based on reading the code I'd think this function returns all properties from a class, not just methods, wouldn't you need to check if the descriptor's value is of type function?

I don't mind making a PR for this, but I first wanted to open a feature request to discuss this. As you might very well have a good reason for not including them in the first place

Metadata

Metadata

Assignees

No one assigned

    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