From b7b5ba02b06acbd4df159ae27e6a69e632228bd2 Mon Sep 17 00:00:00 2001 From: Gar Date: Tue, 30 Apr 2024 00:00:18 -0700 Subject: [PATCH] chore: fix linting in test files --- test/cache.js | 2 +- test/fetch.js | 2 +- test/options.js | 18 +++++++++--------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/test/cache.js b/test/cache.js index f4023da..c459e67 100644 --- a/test/cache.js +++ b/test/cache.js @@ -1548,7 +1548,7 @@ t.test('generic errors streaming from cache propagate to response body', async ( t.teardown(() => { cacache.get.stream.byDigest = realGet }) - cacache.get.stream.byDigest = (cachePath, integrity) => { + cacache.get.stream.byDigest = () => { const stream = new Readable({ read: () => {} }) setImmediate(() => { stream.emit('error', new Error('broken stream')) diff --git a/test/fetch.js b/test/fetch.js index 2754bb1..e9517d9 100644 --- a/test/fetch.js +++ b/test/fetch.js @@ -382,7 +382,7 @@ t.test('supports passthrough of options on redirect', async (t) => { .get('/test') .matchHeader('x-test', 'test') .reply(200, CONTENT, { - 'test-header': (req, res, body) => { + 'test-header': (req) => { t.ok(req.headers['x-test'].length) t.equal(req.headers['x-test'][0], 'test', 'headers from redriect') return 'truthy' diff --git a/test/options.js b/test/options.js index 0434729..b81110d 100644 --- a/test/options.js +++ b/test/options.js @@ -1,12 +1,12 @@ 'use strict' const dns = require('dns') const configureOptions = require('../lib/options.js') -const { test } = require('tap') +const t = require('tap') const defaultDns = { ttl: 5 * 60 * 1000, lookup: dns.lookup } -test('configure options', async (t) => { - test('supplied with no value', async (t) => { +t.test('configure options', async (t) => { + t.test('supplied with no value', async (t) => { const opts = configureOptions() const expectedObject = { method: 'GET', @@ -19,7 +19,7 @@ test('configure options', async (t) => { t.same(opts, expectedObject, 'should return default opts') }) - test('supplied with empty object', async (t) => { + t.test('supplied with empty object', async (t) => { const opts = configureOptions({}) const expectedObject = { method: 'GET', @@ -32,7 +32,7 @@ test('configure options', async (t) => { t.same(opts, expectedObject, 'should return default opts') }) - test('changes method to upper case', async (t) => { + t.test('changes method to upper case', async (t) => { const actualOpts = { method: 'post' } const opts = configureOptions(actualOpts) const expectedObject = { @@ -46,7 +46,7 @@ test('configure options', async (t) => { t.same(opts, expectedObject, 'should return upper cased method') }) - test('copies strictSSL to rejectUnauthorized', async (t) => { + t.test('copies strictSSL to rejectUnauthorized', async (t) => { const trueOpts = configureOptions({ strictSSL: true }) const trueExpectedObject = { method: 'GET', @@ -82,7 +82,7 @@ test('configure options', async (t) => { 'should treat strictSSL: null as true just like tls.connect') }) - test('should set dns property correctly', async (t) => { + t.test('should set dns property correctly', async (t) => { t.test('no property given', async (t) => { const actualOpts = { method: 'GET' } const opts = configureOptions(actualOpts) @@ -127,7 +127,7 @@ test('configure options', async (t) => { }) }) - test('should set retry property correctly', async (t) => { + t.test('should set retry property correctly', async (t) => { t.test('no property given', async (t) => { const actualOpts = { method: 'GET' } const opts = configureOptions(actualOpts) @@ -199,7 +199,7 @@ test('configure options', async (t) => { }) }) - test('configures cache correctly', async (t) => { + t.test('configures cache correctly', async (t) => { t.test('supplied with no values', async (t) => { const actualOpts = {} const opts = configureOptions(actualOpts)