node/test/wpt/test-url.js
Filip Skokan 68e83901f3 test: update WPT resources, common, streams, FileAPI, broadcastchannel
PR-URL: https://github.com/nodejs/node/pull/46912
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2023-03-07 10:19:23 +01:00

17 lines
503 B
JavaScript

'use strict';
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();