diff --git a/package.json b/package.json index 13826a6..7f1eb29 100644 --- a/package.json +++ b/package.json @@ -58,11 +58,11 @@ "url-parse-lax": "^1.0.0" }, "devDependencies": { - "ava": "^0.7.0", + "ava": "^0.8.0", "coveralls": "^2.11.4", "get-port": "^2.0.0", "into-stream": "^2.0.0", - "nyc": "^4.0.1", + "nyc": "^5.0.1", "pem": "^1.4.4", "pify": "^2.3.0", "tempfile": "^1.1.1", @@ -71,10 +71,7 @@ "xo": { "esnext": true, "ignores": [ - "test/**" - ], - "rules": { - "prefer-reflect": 1 - } + "test/_*" + ] } } diff --git a/test/arguments.js b/test/arguments.js index 9e25295..70d6437 100644 --- a/test/arguments.js +++ b/test/arguments.js @@ -4,7 +4,7 @@ import {createServer} from './_server'; let s; -test.before('setup', async t => { +test.before('setup', async () => { s = await createServer(); s.on('/', (req, res) => { @@ -57,6 +57,6 @@ 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 => { +test.after('cleanup', async () => { await s.close(); }); diff --git a/test/error.js b/test/error.js index fd0279c..6d3536a 100644 --- a/test/error.js +++ b/test/error.js @@ -4,7 +4,7 @@ import {createServer} from './_server'; let s; -test.before('setup', async t => { +test.before('setup', async () => { s = await createServer(); s.on('/', (req, res) => { @@ -51,6 +51,6 @@ test('options.body error message', async t => { } }); -test.after('cleanup', async t => { +test.after('cleanup', async () => { await s.close(); }); diff --git a/test/gzip.js b/test/gzip.js index bd8ba0a..9851b08 100644 --- a/test/gzip.js +++ b/test/gzip.js @@ -7,7 +7,7 @@ const testContent = 'Compressible response content.\n'; let s; -test.before('setup', async t => { +test.before('setup', async () => { s = await createServer(); s.on('/', (req, res) => { @@ -56,6 +56,6 @@ test('do not break HEAD responses', async t => { t.is((await got.head(s.url)).body, ''); }); -test.after('cleanup', async t => { +test.after('cleanup', async () => { await s.close(); }); diff --git a/test/headers.js b/test/headers.js index ffc87ce..23a1c22 100644 --- a/test/headers.js +++ b/test/headers.js @@ -4,7 +4,7 @@ import {createServer} from './_server'; let s; -test.before('setup', async t => { +test.before('setup', async () => { s = await createServer(); s.on('/', (req, res) => { @@ -29,7 +29,7 @@ test('accept header with json option', async t => { let headers = (await got(s.url, {json: true})).body; t.is(headers.accept, 'application/json'); - headers = (await got(s.url, {headers: {'accept': ''}, json: true})).body; + headers = (await got(s.url, {headers: {accept: ''}, json: true})).body; t.is(headers.accept, ''); }); @@ -48,6 +48,6 @@ test('zero content-length', async t => { t.is(headers['content-length'], '0'); }); -test.after('cleanup', async t => { +test.after('cleanup', async () => { await s.close(); }); diff --git a/test/helpers.js b/test/helpers.js index d4514ec..363ff31 100644 --- a/test/helpers.js +++ b/test/helpers.js @@ -4,7 +4,7 @@ import {createServer} from './_server'; let s; -test.before('setup', async t => { +test.before('setup', async () => { s = await createServer(); s.on('/', (req, res) => { @@ -37,6 +37,6 @@ test('promise mode', async t => { } }); -test.after('cleanup', async t => { +test.after('cleanup', async () => { await s.close(); }); diff --git a/test/http.js b/test/http.js index 3a09d0c..c2e4401 100644 --- a/test/http.js +++ b/test/http.js @@ -4,7 +4,7 @@ import {createServer} from './_server'; let s; -test.before('setup', async t => { +test.before('setup', async () => { s = await createServer(); s.on('/', (req, res) => { @@ -70,6 +70,6 @@ test('query option', async t => { t.is((await got(s.url, {query: 'recent=true'})).body, 'recent'); }); -test.after('cleanup', async t => { +test.after('cleanup', async () => { await s.close(); }); diff --git a/test/https.js b/test/https.js index 1bf5bc8..42dd7cb 100644 --- a/test/https.js +++ b/test/https.js @@ -12,7 +12,7 @@ let caRootCert; const pemP = pify(pem, Promise); -test.before('setup', async t => { +test.before('setup', async () => { const caKeys = await pemP.createCertificate({days: 1, selfSigned: true}); caRootKey = caKeys.serviceKey; @@ -58,6 +58,6 @@ test('make request to https server with ca', async t => { t.is(body, 'ok'); }); -test.after('cleanup', async t => { +test.after('cleanup', async () => { await s.close(); }); diff --git a/test/json.js b/test/json.js index b0b08ef..a9b7421 100644 --- a/test/json.js +++ b/test/json.js @@ -4,7 +4,7 @@ import {createServer} from './_server'; let s; -test.before('setup', async t => { +test.before('setup', async () => { s = await createServer(); s.on('/', (req, res) => { @@ -73,6 +73,6 @@ test('catches errors on invalid non-200 responses', async t => { } }); -test.after('cleanup', async t => { +test.after('cleanup', async () => { await s.close(); }); diff --git a/test/post.js b/test/post.js index 5557940..70093c6 100644 --- a/test/post.js +++ b/test/post.js @@ -5,7 +5,7 @@ import {createServer} from './_server'; let s; -test.before('setup', async t => { +test.before('setup', async () => { s = await createServer(); s.on('/', (req, res) => { @@ -109,6 +109,6 @@ test('content-type header is not overriden when object in options.body', async t t.is(body['content-type'], 'doge'); }); -test.after('cleanup', async t => { +test.after('cleanup', async () => { await s.close(); }); diff --git a/test/redirects.js b/test/redirects.js index a723e8b..7680543 100644 --- a/test/redirects.js +++ b/test/redirects.js @@ -4,7 +4,7 @@ import {createServer} from './_server'; let s; -test.before('setup', async t => { +test.before('setup', async () => { s = await createServer(); s.on('/', (req, res) => { @@ -78,6 +78,6 @@ test('redirect only GET and HEAD requests', async t => { } }); -test.after('cleanup', async t => { +test.after('cleanup', async () => { await s.close(); }); diff --git a/test/retry.js b/test/retry.js index d4f42d0..1ac842d 100644 --- a/test/retry.js +++ b/test/retry.js @@ -7,7 +7,7 @@ let trys = 0; let knocks = 0; let fifth = 0; -test.before('setup', async t => { +test.before('setup', async () => { s = await createServer(); s.on('/long', () => {}); @@ -69,6 +69,6 @@ test('falsy value prevent retries', async t => { } }); -test.after('cleanup', async t => { +test.after('cleanup', async () => { await s.close(); }); diff --git a/test/stream.js b/test/stream.js index 2d5aacf..d5ba4d2 100644 --- a/test/stream.js +++ b/test/stream.js @@ -5,7 +5,7 @@ import {createServer} from './_server'; let s; -test.before('setup', async t => { +test.before('setup', async () => { s = await createServer(); s.on('/', (req, res) => { @@ -117,9 +117,8 @@ test.cb('accepts option.body as Stream', t => { t.is(chunk.toString(), 'wow'); t.end(); }); - }); -test.after('cleanup', async t => { +test.after('cleanup', async () => { await s.close(); }); diff --git a/test/unix-socket.js b/test/unix-socket.js index 7237d52..6cda334 100644 --- a/test/unix-socket.js +++ b/test/unix-socket.js @@ -8,7 +8,7 @@ const socketPath = tempfile('.socket'); let s; -test.before('setup', async t => { +test.before('setup', async () => { s = await createServer(); s.on('/', (req, res) => { @@ -28,6 +28,6 @@ test('protocol-less works', async t => { t.is((await got(url)).body, 'ok'); }); -test.after('cleanup', async t => { +test.after('cleanup', async () => { await s.close(); });