Skip to content

Instantly share code, notes, and snippets.

@krishna-acondy
Created May 23, 2019 20:47
Show Gist options
  • Save krishna-acondy/7f2ee7bb88e09c3f7993c88e08500ea9 to your computer and use it in GitHub Desktop.
Save krishna-acondy/7f2ee7bb88e09c3f7993c88e08500ea9 to your computer and use it in GitHub Desktop.
Angular Unit Testing - DashboardComponent
describe('DashboardComponent', () => {
let component: DashboardComponent;
let fixture: ComponentFixture<DashboardComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [
DashboardComponent,
TodosComponent
],
providers: [
{ provide: DashboardService, useClass: DashboardServiceMock },
{ provide: TodoService, useClass: TodoServiceMock }
]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(DashboardComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment