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

Create spys from class automatically #12695

Closed
cedricongjh opened this issue Jan 23, 2024 · 0 comments · Fixed by #12696
Closed

Create spys from class automatically #12695

cedricongjh opened this issue Jan 23, 2024 · 0 comments · Fixed by #12696
Assignees

Comments

@cedricongjh
Copy link
Contributor

Description of feature/enhancement
Currently, developers need to manually create spy objects that mock a service/component:

e.g.
image

Let's create a testing utility function that automatically creates these spy objects for us

Justification

This will improve the developer experience when writing tests, instead of having the developer having to repeat the mock object, they can simply call the function once to create the object for them.

An added benefit would be that the spy object created be typed instead of any, and our IDEs would be able to autocomplete the method name for us whenever we are accessing the spy method of an object.

@cedricongjh cedricongjh self-assigned this Jan 23, 2024
cedricongjh added a commit that referenced this issue Jan 24, 2024
* implement createSpyFromClass test-helper

* update all spys to use new test utility
cedricongjh added a commit to cedricongjh/teammates that referenced this issue Feb 20, 2024
…#12696)

* implement createSpyFromClass test-helper

* update all spys to use new test utility
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

Successfully merging a pull request may close this issue.

1 participant