piotrl.net 9
When? Testing huge components
page-xyz.component.spec.ts
TestBed.configureTestingModule(
{
declarations: [
ComponentWeTest,
MockOfChildComponent1,
MockOfChildComponent2,
MockOfChildComponent3, // and so on for up to
MockOfChildComponent4, // 10, 20 mocked child components
MockOfChildComponent5,
MockOfChildComponent6,
],
imports: [
YourModuleWrappingAllDependenciesForAllModules,
ButtonComponentModule, // + other design components
DependentModule1,
DependentModule2,
DependentModule3,
DependentModule4, // and so on for up to
DependentModule1, // 10, 20 imported modules
],
})
EFFECT
Single test suite 20s+
Modified shared direc2ve = broken
test
Dependency mess. Hard to maintain.