Skip to content

Instantly share code, notes, and snippets.

@krishna-acondy
Last active May 23, 2019 21:26
Show Gist options
  • Save krishna-acondy/6f55527317ba3dd34e6fbea228064bb8 to your computer and use it in GitHub Desktop.
Save krishna-acondy/6f55527317ba3dd34e6fbea228064bb8 to your computer and use it in GitHub Desktop.
Angular Unit Testing - TodosComponent
describe('TodosComponent', () => {
let component: TodosComponent;
let fixture: ComponentFixture<TodosComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ TodosComponent ],
providers: [
{ provide: TodoService, useClass: TodoServiceMock }
]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(TodosComponent);
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