Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save AlexLakatos/9c0fa7c6218212a6bd842903344abbb4 to your computer and use it in GitHub Desktop.

Select an option

Save AlexLakatos/9c0fa7c6218212a6bd842903344abbb4 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