Skip to content

Commit

Permalink
tests: ignore catch block when requiring crypto module (#2901)
Browse files Browse the repository at this point in the history
  • Loading branch information
Uzlopak authored Mar 2, 2024
1 parent 28b2df8 commit 7a92eee
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/web/fetch/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

}
Expand Down
1 change: 1 addition & 0 deletions lib/web/websocket/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const { kHeadersList } = require('../../core/symbols')
let crypto
try {
crypto = require('node:crypto')
/* c8 ignore next 3 */
} catch {

}
Expand Down
1 change: 1 addition & 0 deletions lib/web/websocket/frame.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const { maxUnsigned16Bit } = require('./constants')
let crypto
try {
crypto = require('node:crypto')
/* c8 ignore next 3 */
} catch {

}
Expand Down

0 comments on commit 7a92eee

Please sign in to comment.