/
githubmirror
/
angular
Обзор
Документация
Войти
/
githubmirror
/
angular
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
adev/src/app/features/docs/docs.component.spec.ts
49 строк
1 KB
Matthieu Riegler
docs(docs-infra): Modernize tests
05 янв 2026, 19:47
05 янв 2026, 19:47
3a85031
Код
Авторство
О чём код?
/*! * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import {ComponentFixture, TestBed} from '@angular/core/testing'; import DocsComponent from './docs.component'; import {provideRouter} from '@angular/router'; import {DOCS_CONTENT_LOADER, WINDOW} from '@angular/docs'; describe('DocsComponent', () => { let component: DocsComponent; let fixture: ComponentFixture<DocsComponent>; const fakeWindow = { addEventListener: () => {}, removeEventListener: () => {}, }; const fakeContentLoader = { getContent: (id: string) => undefined, }; beforeEach(async () => { TestBed.configureTestingModule({ imports: [DocsComponent], providers: [ provideRouter([]), { provide: WINDOW, useValue: fakeWindow, }, { provide: DOCS_CONTENT_LOADER, useValue: fakeContentLoader, }, ], }); fixture = TestBed.createComponent(DocsComponent); component = fixture.componentInstance; await fixture.whenStable(); }); it('should create', () => { expect(component).toBeTruthy(); }); });