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

docs(recipes): change automock recipe to suites [WIP] #3046

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

Conversation

omermorad
Copy link
Contributor

@omermorad omermorad commented Jun 27, 2024

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Docs

Description and Background

This pull request adds "Suites" (previously Automock) to NestJS's "Recipes" section. Suites supports socialble unit testing, as well as other mocking libraries like Vitest (see Automock Discussions #158). This recipe is intended to guide NestJS users through using NestJS testing tools and Suites for various testing methodologies, making it easier to build reliable and maintainable tests.

Key Features

  • Sociable Testing: Suites allows for sociable testing, focusing on the behavior of units in isolation from their dependencies while maintaining some real interactions.
  • Support for Multiple Mocking Libraries: In addition to Jest, Suites now supports Vitest and Sinon, providing more options for developers.

Detailed Documentation

To ensure that NestJS users can fully use both the built-in testing tools and the extra features of Suites, I have carefully written the documentation to describe the different approaches offered by Suites. Offering precise instructions on when and how to use solitary, social, integration, and e2e tests, the aim is to make testing more organized and less confusing.

Content Summary

  • Introduction to Suites
  • Example and Module Setup - setup for testing modules using NestJS, including examples for solitary and sociable testing from Suites.
  • Integration Testing Example - Guidance on performing integration tests with I/O operations and DI configurations.
  • Comparison Between Testing Strategies - Explanation of the differences and appropriate use cases for sociable, integration, and E2E tests.

I'm submitting this pull request now because it will take time to review it, and we plan to release Suites and redirect the repo from automock/automock once this pull request is ready, as we don't want to cause confusion.

Things you might need to know:

  • We're getting Suites ready to go live and have made a website with instructions (that includes this recipe as well).

  • We will release a migration tool under @suites/cli that will switch the code from Automock to Suites.

  • There will be no new features added to Automock, but we will help and fix bugs.

I would love to hear your feedback to make the docs as clear as possible. It is important for me personally that NestJS users benefit from both worlds. I hope this contribution will help in making the testing process more seamless and effective for everyone.

@omermorad omermorad marked this pull request as draft June 27, 2024 18:27
@omermorad omermorad changed the title docs(recipes): change automock recipe to suites docs(recipes): change automock recipe to suites [] Jun 27, 2024
@omermorad omermorad changed the title docs(recipes): change automock recipe to suites [] docs(recipes): change automock recipe to suites [WIP] Jun 27, 2024
@omermorad omermorad marked this pull request as ready for review June 28, 2024 04:47
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.

None yet

2 participants