Angular 2 Karma Test ‘component-name’ is not a known element

Because in unit tests you want to test the component mostly isolated from other parts of your application, Angular won’t add your module’s dependencies like components, services, etc. by default. So you need to do that manually in your tests. Basically, you have two options here: A) Declare the original NavComponent in the test describe(‘AppComponent’, … Read more

“Error: No provider for router” while writing Karma-Jasmine unit test cases

You need to import RouterTestingModule when setting up the test module. /* tslint:disable:no-unused-variable */ import { async, ComponentFixture, TestBed } from ‘@angular/core/testing’; import { By } from ‘@angular/platform-browser’; import { DebugElement } from ‘@angular/core’; import { RouterTestingModule } from ‘@angular/router/testing’; import { MyNewComponentComponent } from ‘./my-new-component.component’; describe(‘MyNewComponentComponent’, () => { let component: MyNewComponentComponent; let fixture: … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)