Skip to content

Commit f331312

Browse files
committed
Fix tests for newest Node
1 parent 9308eb7 commit f331312

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

test/core.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,9 +285,14 @@ test(
285285
} catch (error) {
286286
const exception = /** @type {ErrnoException} */ (error)
287287
if (!nodeBefore18) {
288-
assert.equal(
289-
exception.code,
290-
'ERR_INVALID_URL',
288+
assert(exception.code)
289+
// To do: when pulling in new Node changes, the code is now
290+
// `ERR_UNSUPPORTED_RESOLVE_REQUEST` (from around Node 21.7).
291+
// Earlier was `ERR_INVALID_URL`.
292+
assert.ok(
293+
['ERR_UNSUPPORTED_RESOLVE_REQUEST', 'ERR_INVALID_URL'].includes(
294+
exception.code
295+
),
291296
'should not be able to resolve relative to a `data:` parent url'
292297
)
293298
}

0 commit comments

Comments
 (0)