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

Add unit tests for sample 06-mongoose #13887

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

martinvysnovsky
Copy link

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Improvements in samples

What is the current behavior?

Sample 06-mongoose is missing some unit tests.

Issue Number: N/A

What is the new behavior?

More unit tests in sample 06-mongoose.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@coveralls
Copy link

Pull Request Test Coverage Report for Build 2d502500-1db4-4ec5-b760-8610b6ab6adf

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 92.213%

Totals Coverage Status
Change from base Build 71551605-c356-4a76-8f46-8de2acf07906: 0.0%
Covered Lines: 6750
Relevant Lines: 7320

💛 - Coveralls

@martinvysnovsky
Copy link
Author

I would like to include E2E tests too, but I need to use a database for that. Usually, I am using testcontainers in my E2E tests. Do you agree to use additional dependency (testcontainers) here?

(also for unit tests of services I do not like to mock the model. Usually, in a real codebase, you have to improve these mocks every time you change the service. I think, using a real database and actually run the queries give you more confidence in your tests. Previously I did use inmemory mongo db, now I am using testcontainers here too. The result is that these tests are not pure unit tests anymore but rather integration tests. Still, I think it makes more sense for services. So again. If you agree then I can rewrite this example to use testcontainers)

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 this pull request may close these issues.

3 participants