Skip to content

Commit

Permalink
test: improve node16 check in test (#2539)
Browse files Browse the repository at this point in the history
  • Loading branch information
Uzlopak committed Oct 19, 2023
1 parent 11d6514 commit 2a7d907
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions tests/test_common.js
Original file line number Diff line number Diff line change
Expand Up @@ -476,13 +476,8 @@ it('`percentEncode()` encodes extra reserved characters', () => {
describe('`normalizeClientRequestArgs()`', () => {
it('should throw for invalid URL', () => {
// See https://github.com/nodejs/node/pull/38614 release in node v16.2.0
const [major, minor, patch] = process.versions.node
.split('.')
.map(num => parseInt(num, 10))
const useNewErrorText =
major > 16 ||
(major === 16 && minor > 2) ||
(major === 16 && minor === 2 && patch > 0)
const [major, minor] = process.versions.node.split('.').map(Number)
const useNewErrorText = major > 16 || (major === 16 && minor > 1)
const errorText = useNewErrorText ? 'Invalid URL' : 'example.test'

// no schema
Expand Down

0 comments on commit 2a7d907

Please sign in to comment.