Skip to content

Instantly share code, notes, and snippets.

@clemcke
clemcke / persos.service.spec.ts
Last active February 8, 2016 09:05
Sample spec that uses appInjector() and a service
import {it, describe, expect, inject, beforeEach, beforeEachProviders} from 'angular2/testing'
import {PersonService, PERSON_SERVICE_PROVIDERS, personServiceLoadedPromise} from './person.service'
// Contents of person.service.ts
//@Injectable()
//export class PersonService {
// constructor(private _http: Http) { }
//
// init(): Promise<boolean>{
// return this._http.get('myurl').toPromise();
// }