Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions docs/api-reference/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ API reference for setting up and managing unit tests with Suites.

### Core APIs

- [**TestBed.solitary()**](/docs/api-reference/testbed-solitary) - Create isolated unit tests where all dependencies are automatically mocked
- [**TestBed.sociable()**](/docs/api-reference/testbed-sociable) - Test business logic interactions, keep specific dependencies real
- [**Mock Configuration**](/docs/api-reference/mock-configuration) - Configure mock behavior with `.mock().final()` and `.mock().impl()`
- [**mock() and stub()**](/docs/api-reference/mock) - Create standalone mocks outside `TestBed` API
- [**UnitReference**](/docs/api-reference/unit-reference) - Access mocked dependencies in tests
- [**Types**](/docs/api-reference/types) - TypeScript type definitions
- [**TestBed.solitary()**](/docs/api-reference/testbed-solitary/) - Create isolated unit tests where all dependencies are automatically mocked
- [**TestBed.sociable()**](/docs/api-reference/testbed-sociable/) - Test business logic interactions, keep specific dependencies real
- [**Mock Configuration**](/docs/api-reference/mock-configuration/) - Configure mock behavior with `.mock().final()` and `.mock().impl()`
- [**mock() and stub()**](/docs/api-reference/mock/) - Create standalone mocks outside `TestBed` API
- [**UnitReference**](/docs/api-reference/unit-reference/) - Access mocked dependencies in tests
- [**Types**](/docs/api-reference/types/) - TypeScript type definitions

</div>

Expand Down
8 changes: 4 additions & 4 deletions docs/api-reference/mock-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Suites provides two methods for configuring mock behavior:
* `.mock().impl()` for flexible implementations

:::note
This page describes the `.mock()` configuration method for `TestBed`. For creating standalone mocks manually, see the [`mock()` and `stub()` utility functions](/docs/api-reference/mock).
This page describes the `.mock()` configuration method for `TestBed`. For creating standalone mocks manually, see the [`mock()` and `stub()` utility functions](/docs/api-reference/mock/).
:::

## Methods
Expand Down Expand Up @@ -123,6 +123,6 @@ const logger = unitRef.get(Logger);

## See Also

- [TestBed.solitary()](/docs/api-reference/testbed-solitary) - Creating isolated tests
- [TestBed.sociable()](/docs/api-reference/testbed-sociable) - Creating sociable tests
- [UnitReference](/docs/api-reference/unit-reference) - Accessing configured mocks
- [TestBed.solitary()](/docs/api-reference/testbed-solitary/) - Creating isolated tests
- [TestBed.sociable()](/docs/api-reference/testbed-sociable/) - Creating sociable tests
- [UnitReference](/docs/api-reference/unit-reference/) - Accessing configured mocks
8 changes: 4 additions & 4 deletions docs/api-reference/mock.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function mock<T>(mockImplementation: DeepPartial<T> = {}): Mocked<T>
`Mocked<T>` - A deeply mocked instance where all methods are automatically stubbed.

:::note
See [Types](/docs/api-reference/types#mockedt) for more about the `Mocked<T>` type.
See [Types](/docs/api-reference/types/#mockedt) for more about the `Mocked<T>` type.
:::

### How It Works
Expand Down Expand Up @@ -286,6 +286,6 @@ obj.method2.mockReturnValue(100);

## See Also

- [Types](/docs/api-reference/types#mocked) - `Mocked<T>` type definition
- [TestBed.solitary()](/docs/api-reference/testbed-solitary) - Automatic dependency mocking
- [TestBed Configuration](/docs/api-reference/testbed-solitary#pre-compile-mock-configuration) - Using `.mock().impl()` with `stub()`
- [Types](/docs/api-reference/types/#mockedt) - `Mocked<T>` type definition
- [TestBed.solitary()](/docs/api-reference/testbed-solitary/) - Automatic dependency mocking
- [TestBed Configuration](/docs/api-reference/testbed-solitary/#configuring-mocks) - Using `.mock().impl()` with `stub()`
8 changes: 4 additions & 4 deletions docs/api-reference/testbed-sociable.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Creates a test environment that mixes real implementations with mocked dependenc
:::info Sociable Tests Are Still Unit Tests
Even with multiple real classes, sociable tests remain unit tests because external I/O (databases, HTTP, caches) are
injected via tokens (`@Inject('DATABASE')`) which are automatically mocked. You're testing business logic interactions,
not actual I/O. See the [Sociable Unit Tests Guide](/docs/guides/sociable) for concepts.
not actual I/O. See the [Sociable Unit Tests Guide](/docs/guides/sociable/) for concepts.
:::

## Signature
Expand Down Expand Up @@ -71,6 +71,6 @@ const database = unitRef.get(Database);

## See Also

- [Sociable Unit Tests Guide](/docs/guides/sociable) - When to use, concepts, detailed examples
- [TestBed.solitary()](/docs/api-reference/testbed-solitary) - For fully isolated tests
- [Mock Configuration](/docs/api-reference/mock-configuration) - Configuring mock behavior
- [Sociable Unit Tests Guide](/docs/guides/sociable/) - When to use, concepts, detailed examples
- [TestBed.solitary()](/docs/api-reference/testbed-solitary/) - For fully isolated tests
- [Mock Configuration](/docs/api-reference/mock-configuration/) - Configuring mock behavior
12 changes: 6 additions & 6 deletions docs/api-reference/testbed-solitary.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ Returns a `SolitaryTestBedBuilder<TClass>` instance with methods for configuring

`TestBed.solitary()` creates a test environment where all of the class's dependencies are mocked by default. This is ideal for testing the internal logic of a class in complete isolation.

Suites automatically identifies and mocks all constructor dependencies, which can then be accessed via `unitRef.get()`. Learn more in the [Virtual Test Container](/docs/guides/virtual-test-container) guide.
Suites automatically identifies and mocks all constructor dependencies, which can then be accessed via `unitRef.get()`. Learn more in the [Virtual Test Container](/docs/guides/virtual-test-container/) guide.

## Configuring Mocks

See [Mock Configuration](/docs/api-reference/mock-configuration) for details on `.mock().final()` and `.mock().impl()`.
See [Mock Configuration](/docs/api-reference/mock-configuration/) for details on `.mock().final()` and `.mock().impl()`.

## Examples

Expand Down Expand Up @@ -85,7 +85,7 @@ repository.invalidMethod.mockReturnValue(123);

## See Also

- [Solitary Tests Guide](/docs/guides/fundamentals#solitary-tests) - Conceptual guide
- [TestBed.sociable()](/docs/api-reference/testbed-sociable) - Test with real dependencies
- [UnitReference](/docs/api-reference/types#unitreference) - Accessing mocked dependencies with `unitRef.get()`
- [Virtual Test Container](/docs/guides/virtual-test-container) - How Suites auto-mocks dependencies
- [Solitary Tests Guide](/docs/guides/solitary/) - Conceptual guide
- [TestBed.sociable()](/docs/api-reference/testbed-sociable/) - Test with real dependencies
- [UnitReference](/docs/api-reference/unit-reference/) - Accessing mocked dependencies with `unitRef.get()`
- [Virtual Test Container](/docs/guides/virtual-test-container/) - How Suites auto-mocks dependencies
6 changes: 3 additions & 3 deletions docs/api-reference/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,6 @@ describe('UserService', () => {

## See Also

- [UnitReference](/docs/api-reference/unit-reference) - Using the UnitReference interface
- [Mock Configuration](/docs/api-reference/mock-configuration) - Configuring mocks with proper types
- [TypeScript Configuration](/docs/get-started/installation#typescript-configuration) - Setting up TypeScript for Suites
- [UnitReference](/docs/api-reference/unit-reference/) - Using the UnitReference interface
- [Mock Configuration](/docs/api-reference/mock-configuration/) - Configuring mocks with proper types
- [TypeScript Configuration](/docs/get-started/installation/#setting-up-tsconfigjson) - Setting up TypeScript for Suites
10 changes: 5 additions & 5 deletions docs/api-reference/unit-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ const database = unitRef.get(Database);

## Type Safety

The `Mocked<T>` type ensures type safety for your mocks (See more in [Types Reference](/docs/api-reference/types):
The `Mocked<T>` type ensures type safety for your mocks (See more in [Types Reference](/docs/api-reference/types/):

```typescript
interface UserRepository {
Expand Down Expand Up @@ -205,7 +205,7 @@ const logger = unitRef.get<Logger>('LoggerToken'); // ✅ Correct symbol

## See Also

- [Types](/docs/api-reference/types) - Type definitions including `Mocked<T>`
- [Mock Configuration](/docs/api-reference/mock-configuration) - Configuring mock behavior
- [TestBed.solitary()](/docs/api-reference/testbed-solitary) - Creating isolated tests
- [TestBed.sociable()](/docs/api-reference/testbed-sociable) - Creating sociable tests
- [Types](/docs/api-reference/types/) - Type definitions including `Mocked<T>`
- [Mock Configuration](/docs/api-reference/mock-configuration/) - Configuring mock behavior
- [TestBed.solitary()](/docs/api-reference/testbed-solitary/) - Creating isolated tests
- [TestBed.sociable()](/docs/api-reference/testbed-sociable/) - Creating sociable tests
2 changes: 1 addition & 1 deletion docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const { unit } = await TestBed.solitary(UserService).compile();
**Migration Support**

We've prepared comprehensive migration guides to help you upgrade smoothly:
- [Migration from Automock →](/docs/migration-guides/from-automock)
- [Migration from Automock →](/docs/migration-guides/from-automock/)
- Migration tool development in progress

[View full release notes →](https://github.com/suites-dev/suites/releases/tag/v3.0.0)
Expand Down
12 changes: 6 additions & 6 deletions docs/get-started/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ Learn how to install Suites, configure the testing environment, and write the fi
<div class="in-this-section">

### In This Section
- [**Why Suites?**](/docs/get-started/why-suites) - Compare with manual mocking and explore what Suites provides
- [**Installation**](/docs/get-started/installation) - Install and configure Suites
- [**Quick Start**](/docs/get-started/quickstart) - Write the first test in 5 minutes
- [**Why Suites?**](/docs/get-started/why-suites/) - Compare with manual mocking and explore what Suites provides
- [**Installation**](/docs/get-started/installation/) - Install and configure Suites
- [**Quick Start**](/docs/get-started/quickstart/) - Write the first test in 5 minutes
</div>

## Prerequisites
Expand All @@ -33,9 +33,9 @@ Currently: dependency injection frameworks (NestJS, InversifyJS) via TestBed, or

For those new to Suites:

1. **[Why Suites?](/docs/get-started/why-suites)** - Explore what Suites provides
2. **[Installation](/docs/get-started/installation)** - Set up the environment
3. **[Quick Start](/docs/get-started/quickstart)** - Write the first test
1. **[Why Suites?](/docs/get-started/why-suites/)** - Explore what Suites provides
2. **[Installation](/docs/get-started/installation/)** - Set up the environment
3. **[Quick Start](/docs/get-started/quickstart/)** - Write the first test
4. **[Guides](/docs/guides/)** - Learn testing patterns

## Resources
Expand Down
2 changes: 1 addition & 1 deletion docs/get-started/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ Vitest 4.x uses Oxc by default instead of esbuild. The `esbuild: false` option i

<div class="next-steps-section">
## What's Next?
- Check out the [Quick Start](/docs/get-started/quickstart) guide to write the first test
- Check out the [Quick Start](/docs/get-started/quickstart/) guide to write the first test
- Explore the [Guides](/docs/guides/) section for testing patterns
- Browse [working examples](https://github.com/suites-dev/examples) for real-world code
</div>
14 changes: 7 additions & 7 deletions docs/get-started/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Complete source code for this example (and more) is available in the [Suites Exa

## Prerequisites

Before starting, ensure the [Installation guide](/docs/get-started/installation) has been completed to set up the project with Suites.
Before starting, ensure the [Installation guide](/docs/get-started/installation/) has been completed to set up the project with Suites.

- Basic knowledge of TypeScript and unit testing
- Familiarity with dependency injection patterns
Expand Down Expand Up @@ -183,7 +183,7 @@ describe('Notification Service Sociable Spec', () => {
:::tip
Sociable tests verify that components integrate correctly while keeping tests fast by mocking external boundaries (databases, HTTP clients, etc.).

Learn more in the [Sociable Unit Testing guide](/docs/guides/sociable).
Learn more in the [Sociable Unit Testing guide](/docs/guides/sociable/).
:::

## How It Works: No Modules, No Bootstrapping
Expand Down Expand Up @@ -268,13 +268,13 @@ const { unit, unitRef } = await TestBed.solitary(UserService).compile();

**The result:** Tests run 20-100x faster while remaining type-safe and maintainable.

**Deep dive:** [Virtual Test Container Guide](/docs/guides/virtual-test-container)
**Deep dive:** [Virtual Test Container Guide](/docs/guides/virtual-test-container/)

## What's Next?

- [Unit Testing Fundamentals](/docs/guides/fundamentals) - Learn about the core principles of unit testing
- [Test Doubles](/docs/guides/test-doubles) - Understand how to work with mocks, stubs, and other test doubles
- [Solitary Unit Testing](/docs/guides/solitary) - Dive deeper into testing components in complete isolation
- [Sociable Unit Testing](/docs/guides/sociable) - Explore testing with real implementations of select dependencies
- [Unit Testing Fundamentals](/docs/guides/fundamentals/) - Learn about the core principles of unit testing
- [Test Doubles](/docs/guides/test-doubles/) - Understand how to work with mocks, stubs, and other test doubles
- [Solitary Unit Testing](/docs/guides/solitary/) - Dive deeper into testing components in complete isolation
- [Sociable Unit Testing](/docs/guides/sociable/) - Explore testing with real implementations of select dependencies

Need help? Join the [Suites community on GitHub Discussions](https://github.com/suites-dev/suites/discussions) or report issues on our [GitHub repository](https://github.com/suites-dev/suites).
4 changes: 2 additions & 2 deletions docs/get-started/why-suites.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ isolated unit testing environment with type-safe test doubles. No boilerplate, n

**Not using dependency injection?**
Use `mock()` and `stub()` for type-safe mocking. Works with any TypeScript code, but requires manual dependency wiring
and reference tracking. See [mock() and stub() utilities](/docs/api-reference/mock).
and reference tracking. See [mock() and stub() utilities](/docs/api-reference/mock/).
:::

```typescript title="order.service.spec.ts" {1,9,11-13}
Expand Down Expand Up @@ -279,4 +279,4 @@ Suites replaces thousands of lines of brittle, manual test setup with a single,
confidence in their unit testing, improve refactor safety with solitary and sociable unit tests, and enable both
developers and AI tools to write and maintain reliable test suites.

**Ready to try it?** Check out the [Quick Start](/docs/get-started/quickstart) guide to write the first test in 5 minutes.
**Ready to try it?** Check out the [Quick Start](/docs/get-started/quickstart/) guide to write the first test in 5 minutes.
14 changes: 7 additions & 7 deletions docs/guides/fundamentals.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,11 @@ Suites supports two approaches based
on [Martin Fowler's distinction between solitary and sociable unit tests](https://martinfowler.com/bliki/UnitTest.html):

* **Solitary Unit Tests** - Test one class in complete isolation. All collaborators are replaced with test doubles to ensure a fault in a dependency does not cause the primary class's tests to fail. \
See [Solitary Unit Tests](/docs/guides/solitary) for examples and usage.
See [Solitary Unit Tests](/docs/guides/solitary/) for examples and usage.

* **Sociable Unit Tests** - Test multiple component classes together with their real collaborators. External I/O
(databases, APIs, file systems) is replaced with test doubles (mocks and stubs) to keep tests fast and deterministic. \
See [Sociable Unit Tests](/docs/guides/sociable) for examples and usage.
See [Sociable Unit Tests](/docs/guides/sociable/) for examples and usage.

Suites follows Fowler's pragmatic approach: use test doubles when collaboration is awkward (external services, I/O), but allow real collaborators when interactions are fast and stable.

Expand All @@ -179,17 +179,17 @@ Suites follows Fowler's pragmatic approach: use test doubles when collaboration
|---------------------|--------------------------------------------------------------------------------------|-------------------------------------------|
| Unit Test | Verifies individual components in isolation | [See above](#what-is-unit-testing) |
| Integration Test | Tests how multiple components work together with real external systems including I/O | N/A - Suites focuses on unit testing |
| Solitary Test | Unit test with all dependencies mocked | [Solitary Guide](/docs/guides/solitary) |
| Sociable Test | Unit test with selected real dependencies, external I/O mocked | [Sociable Guide](/docs/guides/sociable) |
| Solitary Test | Unit test with all dependencies mocked | [Solitary Guide](/docs/guides/solitary/) |
| Sociable Test | Unit test with selected real dependencies, external I/O mocked | [Sociable Guide](/docs/guides/sociable/) |
| Dependency | A collaborator object that a component needs to function | Soon |

## Next Steps

Now that you understand the fundamentals of unit testing with Suites, explore specific testing approaches:

- **[Solitary Unit Testing](/docs/guides/solitary)**: Write tests with complete isolation using automatic mocking
- **[Sociable Unit Testing](/docs/guides/sociable)**: Test multiple classes together with controlled collaboration
- **[Test Doubles in Suites](/docs/guides/test-doubles)**: Learn about mocks, stubs, spies, and when to use each
- **[Solitary Unit Testing](/docs/guides/solitary/)**: Write tests with complete isolation using automatic mocking
- **[Sociable Unit Testing](/docs/guides/sociable/)**: Test multiple classes together with controlled collaboration
- **[Test Doubles in Suites](/docs/guides/test-doubles/)**: Learn about mocks, stubs, spies, and when to use each

## Additional Resources

Expand Down
12 changes: 6 additions & 6 deletions docs/guides/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ Practical guides for writing solitary and sociable unit tests with Suites. Learn

### In This Section

- [**Fundamentals of Unit Testing**](/docs/guides/fundamentals) - Core principles and best practices
- [**Solitary Unit Tests**](/docs/guides/solitary) - Testing components in complete isolation
- [**Sociable Unit Tests**](/docs/guides/sociable) - Testing with real dependencies
- [**Test Doubles**](/docs/guides/test-doubles) - Mocks, stubs, and spies
- [**Virtual Test Container**](/docs/guides/virtual-test-container) - How Suites creates test environments
- [**Fundamentals of Unit Testing**](/docs/guides/fundamentals/) - Core principles and best practices
- [**Solitary Unit Tests**](/docs/guides/solitary/) - Testing components in complete isolation
- [**Sociable Unit Tests**](/docs/guides/sociable/) - Testing with real dependencies
- [**Test Doubles**](/docs/guides/test-doubles/) - Mocks, stubs, and spies
- [**Virtual Test Container**](/docs/guides/virtual-test-container/) - How Suites creates test environments

</div>

:::tip
Start with [Fundamentals](/docs/guides/fundamentals), then [Solitary](/docs/guides/solitary) and [Sociable](/docs/guides/sociable) testing.
Start with [Fundamentals](/docs/guides/fundamentals/), then [Solitary](/docs/guides/solitary/) and [Sociable](/docs/guides/sociable/) testing.
:::

:::tip Working Examples
Expand Down
Loading
Loading