Skip to content

Commit fae3309

Browse files
author
Your Name
committed
Angular Testing Course
1 parent 99f45f7 commit fae3309

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

src/app/courses/home/home.component.spec.ts

+18-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,24 @@ describe('HomeComponent', () => {
2222
let component:HomeComponent;
2323
let el: DebugElement;
2424

25-
beforeEach((() => {
25+
beforeEach(async(() => {
26+
27+
const coursesServiceSpy = jasmine.createSpyObj('CoursesService', ['findAllCourses'])
28+
29+
TestBed.configureTestingModule({
30+
imports: [
31+
CoursesModule,
32+
NoopAnimationsModule
33+
],
34+
providers: [
35+
{provide: CoursesService, useValue: coursesServiceSpy}
36+
]
37+
}).compileComponents()
38+
.then(() => {
39+
fixture = TestBed.createComponent(HomeComponent);
40+
component = fixture.componentInstance;
41+
el = fixture.debugElement;
42+
});
2643

2744

2845
}));

0 commit comments

Comments
 (0)