Comparing version 7.3.7 to 7.3.8
{ | ||
"name": "bent", | ||
"version": "7.3.7", | ||
"version": "7.3.8", | ||
"description": "Functional HTTP client for Node.js w/ async/await.", | ||
@@ -5,0 +5,0 @@ "main": "src/nodejs.js", |
@@ -108,34 +108,17 @@ /* globals atob, it */ | ||
if (process.browser) { | ||
test('status 201', async () => { | ||
const request = bent('string', 201) | ||
const str = await request(u('/echo.js?statusCode=201&body=ok')) | ||
same(str, 'ok') | ||
test('status 201', async () => { | ||
const request = bent('string', 201) | ||
const str = await request(u('/echo.js?statusCode=201&body=ok')) | ||
same(str, 'ok') | ||
try { | ||
await request(u('/echo.js?body=ok')) | ||
throw new Error('Call should have thrown.') | ||
} catch (e) { | ||
same(e.message, null) | ||
// basic header test | ||
same(e.headers['content-length'], '2') | ||
} | ||
}) | ||
} else { | ||
test('status 201', async () => { | ||
const request = bent('string', 201) | ||
const str = await request(u('/echo.js?statusCode=201&body=ok')) | ||
same(str, 'ok') | ||
try { | ||
await request(u('/echo.js?body=ok')) | ||
throw new Error('Call should have thrown.') | ||
} catch (e) { | ||
same(e.message, process.browser ? null : 'OK') | ||
// basic header test | ||
same(e.headers['content-length'], '2') | ||
} | ||
}) | ||
try { | ||
await request(u('/echo.js?body=ok')) | ||
throw new Error('Call should have thrown.') | ||
} catch (e) { | ||
same(e.message, 'OK') | ||
// basic header test | ||
same(e.headers['content-length'], '2') | ||
} | ||
}) | ||
} | ||
test('PUT stream', async () => { | ||
@@ -142,0 +125,0 @@ const body = Buffer.from(Math.random().toString()) |
25932
651