mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
- Deletes the old Karma configuration and test entry point. - Updates `angular.json` to use the `@angular/build` builders. - Adjusts test files to align with the new setup.
43 lines
1.3 KiB
TypeScript
43 lines
1.3 KiB
TypeScript
/*!
|
|
* @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 {TestBed} from '@angular/core/testing';
|
|
import {AppComponent} from './app.component';
|
|
import {provideRouter, withComponentInputBinding} from '@angular/router';
|
|
import {routes} from './routing/routes';
|
|
import {Search, WINDOW} from '@angular/docs';
|
|
import {provideHttpClient} from '@angular/common/http';
|
|
import {provideHttpClientTesting} from '@angular/common/http/testing';
|
|
|
|
describe('AppComponent', () => {
|
|
const fakeSearch = {};
|
|
const fakeWindow = {location: {hostname: 'angular.dev'}};
|
|
|
|
it('should create the app', async () => {
|
|
await TestBed.configureTestingModule({
|
|
imports: [AppComponent],
|
|
providers: [
|
|
provideHttpClient(),
|
|
provideHttpClientTesting(),
|
|
provideRouter(routes, withComponentInputBinding()),
|
|
{
|
|
provide: WINDOW,
|
|
useValue: fakeWindow,
|
|
},
|
|
{
|
|
provide: Search,
|
|
useValue: fakeSearch,
|
|
},
|
|
],
|
|
}).compileComponents();
|
|
|
|
const fixture = TestBed.createComponent(AppComponent);
|
|
const app = fixture.componentInstance;
|
|
expect(app).toBeTruthy();
|
|
});
|
|
});
|