diff --git a/lib/web/fetch/util.js b/lib/web/fetch/util.js index 92bcb6cb202..6cf679b2ced 100644 --- a/lib/web/fetch/util.js +++ b/lib/web/fetch/util.js @@ -12,11 +12,11 @@ const { isUint8Array } = require('node:util/types') const { webidl } = require('./webidl') // https://nodejs.org/api/crypto.html#determining-if-crypto-support-is-unavailable -/** @type {import('crypto')|undefined} */ +/** @type {import('crypto')} */ let crypto - try { crypto = require('node:crypto') +/* c8 ignore next 3 */ } catch { } diff --git a/lib/web/websocket/connection.js b/lib/web/websocket/connection.js index 45f68e1de93..2869ebafb63 100644 --- a/lib/web/websocket/connection.js +++ b/lib/web/websocket/connection.js @@ -20,6 +20,7 @@ const { kHeadersList } = require('../../core/symbols') let crypto try { crypto = require('node:crypto') +/* c8 ignore next 3 */ } catch { } diff --git a/lib/web/websocket/frame.js b/lib/web/websocket/frame.js index ee3087bdf70..30c68c811cd 100644 --- a/lib/web/websocket/frame.js +++ b/lib/web/websocket/frame.js @@ -6,6 +6,7 @@ const { maxUnsigned16Bit } = require('./constants') let crypto try { crypto = require('node:crypto') +/* c8 ignore next 3 */ } catch { }