From 487ede030c96df9761f5a018992b0541ea7d835b Mon Sep 17 00:00:00 2001 From: Tim Deschryver <28659384+timdeschryver@users.noreply.github.com> Date: Sat, 30 May 2026 22:11:35 +0200 Subject: [PATCH] docs(angular): document importOverrides --- docs/angular-testing-library/api.mdx | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/docs/angular-testing-library/api.mdx b/docs/angular-testing-library/api.mdx index 9d20f235..05cd6d93 100644 --- a/docs/angular-testing-library/api.mdx +++ b/docs/angular-testing-library/api.mdx @@ -252,9 +252,25 @@ await render(AppComponent, { }) ``` -### `componentImports` +### `importOverrides` -A collection of imports to override a standalone component's imports with. +A collection of import overrides to replace specific imports of a standalone component without replacing the entire imports array. Each entry specifies which import to `replace` and what to replace it `with`. This is the preferred alternative to `componentImports` when you only want to stub a subset of a component's imports. + +**default** : `undefined` + +**example**: + +```typescript +await render(AppComponent, { + importOverrides: [ + { replace: ChildComponent, with: MockChildComponent }, + ], +}) +``` + +### ~~`componentImports`~~ (deprecated) + +A collection of imports to override **all** of a standalone component's imports with. Prefer [`importOverrides`](#importOverrides) when you only need to replace specific imports. **default** : `undefined`