diff --git a/test/http.js b/test/http.js index d5553dc..21e7592 100644 --- a/test/http.js +++ b/test/http.js @@ -15,6 +15,11 @@ test.before('setup', async () => { res.end(); }); + s.on('/304', (req, res) => { + res.statusCode = 304; + res.end(); + }); + s.on('/404', (req, res) => { setTimeout(() => { res.statusCode = 404; @@ -56,6 +61,14 @@ test('error with code', async t => { } }); +test('status code 304 doesn\'t throw', async t => { + const p = got(`${s.url}/304`); + await t.notThrows(p); + const response = await p; + t.is(response.statusCode, 304); + t.is(response.body, ''); +}); + test('buffer on encoding === null', async t => { const data = (await got(s.url, {encoding: null})).body; t.truthy(Buffer.isBuffer(data));