Skip to content

Commit

Permalink
test: mediaType request option
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m committed Mar 14, 2019
1 parent 47ac6f5 commit 21e7a01
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion test/integration/smoke-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,43 @@ describe('smoke', () => {
const octokit = new Octokit({
baseUrl: 'https://smoke-test.com',
previews: [
// test with & without -preview suffix
'jean-grey-preview',
'symmetra-preview'
'symmetra'
]
})

return octokit.request('/')
})

it('mediaType request option', () => {
nock('https://smoke-test.com', {
reqheaders: {
'accept': 'application/vnd.github.foo-preview.raw,application/vnd.github.bar-preview.raw,application/vnd.github.baz-preview.raw'
}
})
.get('/')
.reply(200, {})

const octokit = new Octokit({
baseUrl: 'https://smoke-test.com',
previews: [
'foo',
'bar-preview'
]
})

return octokit.request('/', {
mediaType: {
previews: [
'bar',
'baz-preview'
],
format: 'raw'
}
})
})

it('request option', () => {
const octokit = new Octokit({
request: {
Expand Down

0 comments on commit 21e7a01

Please sign in to comment.