I am unit testing a component that is used to edit an object. The object has an unique id that is used in order to grab the specific object from an array of obj
id
Here is how I tested it in angular 2.0 latest...
import { ActivatedRoute, Data } from '@angular/router';
and in Providers section
{ provide: ActivatedRoute, useValue: { data: { subscribe: (fn: (value: Data) => void) => fn({ yourData: 'yolo' }) } } }