Skip to content

Commit

Permalink
chore: Correct sorting of one test
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmelnikow authored and gr2m committed May 2, 2019
1 parent 70930ab commit 6d31b14
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
14 changes: 14 additions & 0 deletions tests/test_reply_function_async.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,20 @@ const got = require('./got_client')

require('./cleanup_after_each')()

test('reply can take a callback', async t => {
const scope = nock('http://example.com')
.get('/')
.reply(200, (path, requestBody, callback) => callback(null, 'Hello World!'))

const response = await got('http://example.com/', {
encoding: null,
})

scope.done()
t.type(response.body, Buffer)
t.equal(response.body.toString('utf8'), 'Hello World!')
})

test('reply takes a callback for status code', async t => {
const expectedStatusCode = 202
const responseBody = 'Hello, world!'
Expand Down
14 changes: 0 additions & 14 deletions tests/test_reply_function_sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,20 +169,6 @@ test("when request has no content-type header: reply callback's requestBody shou
scope.done()
})

test('reply can take a callback', async t => {
const scope = nock('http://example.com')
.get('/')
.reply(200, (path, requestBody, callback) => callback(null, 'Hello World!'))

const response = await got('http://example.com/', {
encoding: null,
})

scope.done()
t.type(response.body, Buffer)
t.equal(response.body.toString('utf8'), 'Hello World!')
})

test('reply should send correct statusCode with array-notation and without body', async t => {
t.plan(1)

Expand Down

0 comments on commit 6d31b14

Please sign in to comment.