Created
October 8, 2019 12:04
-
-
Save IAfanasovMob/255c18ec2c8eebbc02328187cb342c8a 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
it(`should add Accept header with value 'application/vnd.github.v3.star+json' | |
when requested https://api.github.com/*`, () => { | |
client.get('https://api.github.com/anything').subscribe(); | |
const requests = httpMock.match({ method: 'get' }); | |
expect(requests[0].request.headers.get('Accept')) | |
.toEqual('application/vnd.github.v3.star+json'); | |
}); | |
it(`should NOT add Accept header when requested NOT https://api.github.com/*`, () => { | |
client.get('https://not-a-github-api.com/anything').subscribe(); | |
const requests = httpMock.match({ method: 'get' }); | |
expect(requests[0].request.headers.has('Accept')).toEqual(false); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment