Skip to content

Instantly share code, notes, and snippets.

@Janneman96
Janneman96 / blog-feed.component.ts
Last active November 22, 2017 14:30
How to unit test in Angular 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.