test: skip url WPT subtests instead of modifying test script

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/62635
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
Filip Skokan authored and GitHub committed 2026-04-10 11:27:31 +00:00
1 parent 4dc18ef29d
commit 4dba22f367
3 files changed
+25 -26

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
'use strict';
module.exports = {
'historical.any.js': {
'fail': {
'expected': [
'searchParams on location object',
],
},
},
'javascript-urls.window.js': {
'skip': 'requires document.body reference',
},
'percent-encoding.window.js': {
'skip': 'requires document.body reference',
},
'toascii.window.js': {
'skipTests': [
/\(using <a(rea)?>/,
],
},
'url-setters-a-area.window.js': {
'skip': 'already tested in url-setters.any.js',
},
};
-18
View File
@@ -1,18 +0,0 @@
{
"historical.any.js": {
"fail": {
"expected": [
"searchParams on location object"
]
}
},
"javascript-urls.window.js": {
"skip": "requires document.body reference"
},
"percent-encoding.window.js": {
"skip": "TODO: port from .window.js"
},
"url-setters-a-area.window.js": {
"skip": "already tested in url-setters.any.js"
}
}
-8
View File
@@ -10,13 +10,5 @@ const { WPTRunner } = require('../common/wpt');
const runner = new WPTRunner('url');
runner.setScriptModifier((obj) => {
if (obj.filename.includes('toascii.window.js')) {
// `a` and `area` in `toascii.window.js` is for testing `Element` that
// created via `document.createElement`. So we need to ignore them and just
// test `URL`.
obj.code = obj.code.replace(/\["url", "a", "area"\]/, '[ "url" ]');
}
});
runner.pretendGlobalThisAs('Window');
runner.runJsTests();