Skip to content

Commit

Permalink
Fix tests for newest Node
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Mar 12, 2024
1 parent 9308eb7 commit f331312
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions test/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,14 @@ test(
} catch (error) {
const exception = /** @type {ErrnoException} */ (error)
if (!nodeBefore18) {
assert.equal(
exception.code,
'ERR_INVALID_URL',
assert(exception.code)
// To do: when pulling in new Node changes, the code is now
// `ERR_UNSUPPORTED_RESOLVE_REQUEST` (from around Node 21.7).
// Earlier was `ERR_INVALID_URL`.
assert.ok(
['ERR_UNSUPPORTED_RESOLVE_REQUEST', 'ERR_INVALID_URL'].includes(
exception.code
),
'should not be able to resolve relative to a `data:` parent url'
)
}
Expand Down

0 comments on commit f331312

Please sign in to comment.