From 10a934a12db7d4ed3023f77711e5292897374a87 Mon Sep 17 00:00:00 2001 From: Travis Warlick Date: Sat, 28 Nov 2020 14:16:38 -0500 Subject: [PATCH] c8 ignores for node-version-specific code and fix c8 ignore in Headers constructor --- src/headers.js | 4 +++- src/index.js | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/headers.js b/src/headers.js index 66ea30321..cd6945580 100644 --- a/src/headers.js +++ b/src/headers.js @@ -7,6 +7,7 @@ import {types} from 'node:util'; import http from 'node:http'; +/* c8 ignore next 9 */ const validateHeaderName = typeof http.validateHeaderName === 'function' ? http.validateHeaderName : name => { @@ -17,6 +18,7 @@ const validateHeaderName = typeof http.validateHeaderName === 'function' ? } }; +/* c8 ignore next 9 */ const validateHeaderValue = typeof http.validateHeaderValue === 'function' ? http.validateHeaderValue : (name, value) => { @@ -141,8 +143,8 @@ export default class Headers extends URLSearchParams { return Reflect.get(target, p, receiver); } } - /* c8 ignore next */ }); + /* c8 ignore next */ } get [Symbol.toStringTag]() { diff --git a/src/index.js b/src/index.js index ef3829462..312cd1317 100644 --- a/src/index.js +++ b/src/index.js @@ -237,6 +237,7 @@ export default async function fetch(url, options_) { let body = pump(response_, new PassThrough(), reject); // see https://github.com/nodejs/node/pull/29376 + /* c8 ignore next 3 */ if (process.version < 'v12.10') { response_.on('aborted', abortAndFinalize); }