Get Started

Suites helps you unit test TypeScript classes built with NestJS, InversifyJS, or InjectionJS. Run your tests with Jest or Vitest. Suites creates the class and its dependency mocks; your runner executes the tests and checks assertions.

Supported frameworks and runners

Every framework below works with either test runner:

Dependency injection frameworkJestVitest
NestJSSupportedSupported
InversifyJSSupportedSupported
InjectionJSSupportedSupported

Keep your framework and choose the runner that fits your project. The same Suites testing API works across these combinations.

InjectionJS support covers constructor injection. Contextual inject() calls, including class field initializers, are not supported. Follow the InjectionJS guide for a complete example.

No DI framework? Use the standalone mock() and stub() utilities with Jest or Vitest to create test doubles for plain TypeScript code.

Upgrading from Suites 3? See the migration guide.

In This Section

  • Why Suites? - Compare with manual mocking and explore what Suites provides
  • Installation - Install and configure Suites

For those new to Suites:

  1. Why Suites? - Explore what Suites provides
  2. Installation - Set up the environment
  3. Quick Start - Choose your framework and write your first test with Jest or Vitest
  4. Guides - Learn testing patterns

Resources