Skip to content

Instantly share code, notes, and snippets.

@gsans
Last active July 21, 2017 11:15
Show Gist options
  • Save gsans/6f3a7a663c1dc7ba141c8fef217608fa to your computer and use it in GitHub Desktop.
Save gsans/6f3a7a663c1dc7ba141c8fef217608fa to your computer and use it in GitHub Desktop.
languagesServiceHttp.spec.ts
describe('Service: LanguagesServiceHttp', () => {
let service;
//setup
beforeEach(() => TestBed.configureTestingModule({
imports: [ HttpModule ],
providers: [ LanguagesServiceHttp ]
}));
beforeEach(inject([LanguagesServiceHttp], s => {
service = s;
}));
//specs
it('should return available languages', async(() => {
service.get().subscribe(x => {
expect(x).toContain('en');
expect(x).toContain('es');
expect(x).toContain('fr');
expect(x.length).toEqual(3);
});
}));
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment