test: use assert.match in test-esm-import-meta

PR-URL: https://github.com/nodejs/node/pull/57290
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
This commit is contained in:
Antoine du Hamel 2025-03-07 05:33:56 +00:00 committed by GitHub
parent 8032e96cc8
commit 365faa7a4f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -17,7 +17,7 @@ for (const descriptor of Object.values(descriptors)) {
}
const urlReg = /^file:\/\/\/.*\/test\/es-module\/test-esm-import-meta\.mjs$/;
assert(import.meta.url.match(urlReg));
assert.match(import.meta.url, urlReg);
// Match *nix paths: `/some/path/test/es-module`
// Match Windows paths: `d:\\some\\path\\test\\es-module`