Created
August 19, 2017 15:22
-
-
Save cironunes/3564f4572880438ad1f99702397cee1b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('#getUsers', () => { | |
it('should return an Observable<User[]>', () => { | |
const dummyUsers = [ | |
{ login: 'John' }, | |
{ login: 'Doe' } | |
]; | |
service.getUsers().subscribe(users => { | |
expect(users.length).toBe(2); | |
expect(users).toEqual(dummyUsers); | |
}); | |
const req = httpMock.expectOne(`${service.API_URL}/users`); | |
expect(req.request.method).toBe("GET"); | |
req.flush(dummyUsers); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment