From 24f9d3fbebf6270cef4d7943323ed61a321ddd9d Mon Sep 17 00:00:00 2001 From: Mattias Buelens <649348+MattiasBuelens@users.noreply.github.com> Date: Mon, 20 Nov 2023 13:07:55 +0100 Subject: [PATCH] test: enable idlharness tests for encoding TextDecoderStream and TextEncoderStream are now exposed as globals, so we can run the entire Encoding idlharness test suite. PR-URL: https://github.com/nodejs/node/pull/50778 Reviewed-By: Filip Skokan Reviewed-By: Yagiz Nizipli Reviewed-By: Luigi Pinca Reviewed-By: James M Snell Reviewed-By: Benjamin Gruenbaum --- test/common/wpt.js | 2 +- test/wpt/status/encoding.json | 2 +- test/wpt/test-encoding.js | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/test/common/wpt.js b/test/common/wpt.js index 7d0b030614b003..0673d4bc8d721e 100644 --- a/test/common/wpt.js +++ b/test/common/wpt.js @@ -610,7 +610,7 @@ class WPTRunner { 'ReadableStreamBYOBReader', 'ReadableStreamBYOBRequest', 'ReadableByteStreamController', 'ReadableStreamDefaultController', 'ByteLengthQueuingStrategy', 'CountQueuingStrategy', - 'TextEncoderStream', 'TextDecoderStream', + 'TextEncoder', 'TextDecoder', 'TextEncoderStream', 'TextDecoderStream', 'CompressionStream', 'DecompressionStream', ]; if (Boolean(process.versions.openssl) && !process.env.NODE_SKIP_CRYPTO) { diff --git a/test/wpt/status/encoding.json b/test/wpt/status/encoding.json index 09f8c2b545b247..db481cca6a09df 100644 --- a/test/wpt/status/encoding.json +++ b/test/wpt/status/encoding.json @@ -37,7 +37,7 @@ "skip": "The iso-8859-16 encoding is not supported" }, "idlharness.any.js": { - "skip": "No implementation of TextDecoderStream and TextEncoderStream" + "requires": ["small-icu"] }, "idlharness-shadowrealm.window.js": { "skip": "ShadowRealm support is not enabled" diff --git a/test/wpt/test-encoding.js b/test/wpt/test-encoding.js index af20760bd533d3..eb54c70867cb43 100644 --- a/test/wpt/test-encoding.js +++ b/test/wpt/test-encoding.js @@ -3,4 +3,6 @@ const { WPTRunner } = require('../common/wpt'); const runner = new WPTRunner('encoding'); +runner.pretendGlobalThisAs('Window'); + runner.runJsTests();