the component type being rendered.
OptionalautoUse autoDetectChanges() instead of a single detectChanges(). Set this for
components that mutate their own state during init/CD (recompute a bound value in
ngOnInit/ngOnChanges), which would otherwise trip the dev-mode NG0100 check.
OptionaldeclarationsComponents/directives to declare. Pass these for a module-declared
(standalone: false) component that you configure via inputs (not projected
children) — include the component itself plus any child components it renders.
Standalone components need neither imports nor declarations.
OptionalimportsModules to import (e.g. CommonModule, FormsModule). Provide when the component
(or a declarations entry) needs them.
Optionalinputs@Inputs to apply, by name. Set via componentRef.setInput, which is the
zoneless-correct way to mark the view dirty (avoids the NG0100
ExpressionChangedAfterItHasBeenCheckedError that bites when state is mutated
after the first change-detection pass). See guides/ANGULAR_TESTING_GUIDE.md §5.
OptionalprovidersProviders to register in the testing module — supply stub/fake versions of any
services the component injects via its constructor. A component with
constructor-injected services cannot even be constructed without these, so this
is the seam for presentational components that take services but only touch them in
event handlers (not during render). Prefer minimal { provide: X, useValue: ... }
stubs over the real service. See guides/ANGULAR_TESTING_GUIDE.md.
OptionalsetupImperative setup run AFTER inputs are applied but BEFORE the first
detectChanges() — call component methods, set internal state, or wire spies
to @Outputs. Receives the live component instance and its ComponentRef.
Running before the single render is what keeps the test NG0100-safe.
Options for renderComponentFixture.