Skip to content

Commit 2a7d907

Browse files
authored
test: improve node16 check in test (#2539)
1 parent 11d6514 commit 2a7d907

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

tests/test_common.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -476,13 +476,8 @@ it('`percentEncode()` encodes extra reserved characters', () => {
476476
describe('`normalizeClientRequestArgs()`', () => {
477477
it('should throw for invalid URL', () => {
478478
// See https://github.com/nodejs/node/pull/38614 release in node v16.2.0
479-
const [major, minor, patch] = process.versions.node
480-
.split('.')
481-
.map(num => parseInt(num, 10))
482-
const useNewErrorText =
483-
major > 16 ||
484-
(major === 16 && minor > 2) ||
485-
(major === 16 && minor === 2 && patch > 0)
479+
const [major, minor] = process.versions.node.split('.').map(Number)
480+
const useNewErrorText = major > 16 || (major === 16 && minor > 1)
486481
const errorText = useNewErrorText ? 'Invalid URL' : 'example.test'
487482

488483
// no schema

0 commit comments

Comments
 (0)