From 31846ded2d27706ec5e5334fa7e600e2da7ebcd6 Mon Sep 17 00:00:00 2001
From: Charles Lyding <19598772+clydin@users.noreply.github.com>
Date: Fri, 7 Nov 2025 12:30:17 -0500
Subject: [PATCH] docs: remove invalid service dependency guide section
The current section `Services with dependencies` within the testing services
guide is non-functional and has been removed. The example service is using
`inject` but the test code is using constructor-based injection. The further
sections discuss the use of TestBed to adjust providers which better handles
these cases.
(cherry picked from commit e3143036baa6559ec7ce1d15358f34d822d3076d)
---
adev/src/content/guide/testing/services.md | 28 ----------------------
1 file changed, 28 deletions(-)
diff --git a/adev/src/content/guide/testing/services.md b/adev/src/content/guide/testing/services.md
index 95cf31140bf..3ecd1cef33e 100644
--- a/adev/src/content/guide/testing/services.md
+++ b/adev/src/content/guide/testing/services.md
@@ -7,34 +7,6 @@ Here are some synchronous and asynchronous unit tests of the `ValueService` writ
-## Services with dependencies
-
-Services often depend on other services that Angular injects into the constructor.
-In many cases, you can create and _inject_ these dependencies by hand while calling the service's constructor.
-
-The `MasterService` is a simple example:
-
-
-
-`MasterService` delegates its only method, `getValue`, to the injected `ValueService`.
-
-Here are several ways to test it.
-
-
-
-The first test creates a `ValueService` with `new` and passes it to the `MasterService` constructor.
-
-However, injecting the real service rarely works well as most dependent services are difficult to create and control.
-
-Instead, mock the dependency, use a dummy value, or create a [spy](https://jasmine.github.io/tutorials/your_first_suite#section-Spies) on the pertinent service method.
-
-HELPFUL: Prefer spies as they are usually the best way to mock services.
-
-These standard testing techniques are great for unit testing services in isolation.
-
-However, you almost always inject services into application classes using Angular dependency injection and you should have tests that reflect that usage pattern.
-Angular testing utilities make it straightforward to investigate how injected services behave.
-
## Testing services with the `TestBed`
Your application relies on Angular [dependency injection (DI)](guide/di) to create services.