|
|
@ -33,6 +33,17 @@ test('url is required', async t => { |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
test('options are optional', async t => { |
|
|
|
t.is((await got(`${s.url}/test`)).body, '/test'); |
|
|
|
}); |
|
|
|
|
|
|
|
test('options are optional', t => { |
|
|
|
got(`${s.url}/test`, function (err, data) { |
|
|
|
t.is(data, '/test'); |
|
|
|
t.end(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
test('accepts url.parse object as first argument', async t => { |
|
|
|
t.is((await got({hostname: s.host, port: s.port, path: '/test'})).body, '/test'); |
|
|
|
}); |
|
|
@ -50,6 +61,10 @@ test('should throw with auth in url', async t => { |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
test('accepts url.parse object as first argument', async t => { |
|
|
|
t.is((await got({hostname: s.host, port: s.port, path: '/test'})).body, '/test'); |
|
|
|
}); |
|
|
|
|
|
|
|
test.after('cleanup', async t => { |
|
|
|
await s.close(); |
|
|
|
}); |
|
|
|