Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auto detect getters/setters just like methods #74

Open
chris-kruining opened this issue Jul 25, 2023 · 0 comments
Open

auto detect getters/setters just like methods #74

chris-kruining opened this issue Jul 25, 2023 · 0 comments

Comments

@chris-kruining
Copy link

chris-kruining commented Jul 25, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant