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

[#12695] implement createSpyFromClass test-helper #12696

Merged

Conversation

cedricongjh
Copy link
Contributor

Fixes #12695

Outline of Solution
Create createSpyFromClass test utility function to automatically create spy objects for us

Copy link

Hi @cedricongjh, thank you for your interest in contributing to TEAMMATES!
However, your PR does not appear to follow our contribution guidelines:

  • Title must start with the issue number the PR is fixing in square brackets, e.g. [#<issue-number>]

Please address the above before we proceed to review your PR.

@cedricongjh cedricongjh changed the title implement createSpyFromClass test-helper [#12695] implement createSpyFromClass test-helper Jan 23, 2024
Copy link
Contributor

@ziqing26 ziqing26 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The helper LGTM! Just one question: would it be good to change other tests that mock services in this PR as well? For example, src/web/services/course.service.spec.ts

Copy link
Contributor

@ziqing26 ziqing26 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@cedricongjh cedricongjh merged commit f6e2c56 into TEAMMATES:master Jan 24, 2024
9 checks passed
@wkurniawan07 wkurniawan07 added s.ToMerge The PR is approved by all reviewers including final reviewer; ready for merging c.Task Other non-user-facing works, e.g. refactoring, adding tests labels Jan 26, 2024
@wkurniawan07 wkurniawan07 added this to the V8.30.0 milestone Jan 26, 2024
cedricongjh added a commit to cedricongjh/teammates that referenced this pull request 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
c.Task Other non-user-facing works, e.g. refactoring, adding tests s.ToMerge The PR is approved by all reviewers including final reviewer; ready for merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create spys from class automatically
3 participants