mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-22 23:15:56 +08:00
Currently when using `ivy-ngcc` it will print out a warning ``` Failed to read entry point info from //node_modules/@schematics/angular/workspace/files/package.json with error SyntaxError: Unexpected token < in JSON at position 1121. ``` Fixes #13378
36 lines
1.1 KiB
Plaintext
36 lines
1.1 KiB
Plaintext
import { TestBed, async } from '@angular/core/testing';<% if (routing) { %>
|
|
import { RouterTestingModule } from '@angular/router/testing';<% } %>
|
|
import { AppComponent } from './app.component';
|
|
|
|
describe('AppComponent', () => {
|
|
beforeEach(async(() => {
|
|
TestBed.configureTestingModule({<% if (routing) { %>
|
|
imports: [
|
|
RouterTestingModule
|
|
],<% } %>
|
|
declarations: [
|
|
AppComponent
|
|
],
|
|
}).compileComponents();
|
|
}));
|
|
|
|
it('should create the app', () => {
|
|
const fixture = TestBed.createComponent(AppComponent);
|
|
const app = fixture.debugElement.componentInstance;
|
|
expect(app).toBeTruthy();
|
|
});
|
|
|
|
it(`should have as title '<%= name %>'`, () => {
|
|
const fixture = TestBed.createComponent(AppComponent);
|
|
const app = fixture.debugElement.componentInstance;
|
|
expect(app.title).toEqual('<%= name %>');
|
|
});
|
|
|
|
it('should render title in a h1 tag', () => {
|
|
const fixture = TestBed.createComponent(AppComponent);
|
|
fixture.detectChanges();
|
|
const compiled = fixture.debugElement.nativeElement;
|
|
expect(compiled.querySelector('h1').textContent).toContain('Welcome to <%= name %>!');
|
|
});
|
|
});
|