node/test/wpt/test-url.js
Kohei Ueno 34785657fb
test: complete TODO in test/wpt/test-url.js
PR-URL: https://github.com/nodejs/node/pull/43797
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2022-07-14 16:24:00 +01:00

17 lines
525 B
JavaScript

'use strict';
require('../common');
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();