Skip to content

Instantly share code, notes, and snippets.

View Aridian1842's full-sized avatar

Mohammad Naveed Aridian1842

  • Pakistan Punjab Rawalpindi
View GitHub Profile
@Aridian1842
Aridian1842 / 0 - INDEX
Created November 8, 2017 15:39
Angular Unit Test Cheats
1) Cleanly providing stubs in a test
2) Unit testing an interceptor
3) Mocking injection token
@Aridian1842
Aridian1842 / blog-feed.component.ts
Created November 8, 2017 15:45 — forked from Janneman96/blog-feed.component.ts
How to unit test in Angular 2 TypeScript using Jasmine
import {BlogFeedComponent} from './blog-feed.component';
import {CoreApiService} from "../../../services/api/api.service";
import {IBlogFeed} from "./blog-feed.component.interface";
import createSpy = jasmine.createSpy;
import createSpyObj = jasmine.createSpyObj;
/**
* In the describe function, we describe what we are testing. In this case, we are testing the BlogFeedComponent.
*
* We can run all tests by running "ng test" in the terminal at the root directory of this project.