Question Details

No question body available.

Tags

angular vitest

Answers (1)

February 16, 2026 Score: 0 Rep: 66,678 Quality: Low Completeness: 50%

The sequence is incorrect, we should createComponent after TestBed.configureTestingModule.

describe('Redirect (Vitest)', () => {
    let fixture: ComponentFixture;
    let component: Redirect;

beforeEach(async () => { await TestBed.configureTestingModule({ imports: [Redirect,CommonModule], schemas: [NOERRORSSCHEMA] }).compileComponents(); });

beforeEach(() => { fixture = TestBed.createComponent(Redirect); component = fixture.componentInstance; });

it('should create', async () => { fixture.detectChanges(); await fixture.whenStable(); expect(component).toBeTruthy(); }); });