Skip to content

Commit 499750f

Browse files
aduh95BethGriggs
authored andcommitted
test: update list of known globals
This is important to allow to run v16 doc tests on more recent versions. PR-URL: #45255 Refs: https://github.com/nodejs/node/actions/runs/3356902660/jobs/5562322617 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Beth Griggs <[email protected]>
1 parent 03dcbe3 commit 499750f

File tree

1 file changed

+32
-8
lines changed

1 file changed

+32
-8
lines changed

test/common/index.js

+32-8
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,9 @@ if (global.gc) {
291291
knownGlobals.push(global.gc);
292292
}
293293

294+
if (global.Performance) {
295+
knownGlobals.push(global.Performance);
296+
}
294297
if (global.performance) {
295298
knownGlobals.push(global.performance);
296299
}
@@ -301,16 +304,16 @@ if (global.PerformanceMeasure) {
301304
knownGlobals.push(global.PerformanceMeasure);
302305
}
303306

304-
if (global.fetch) {
305-
knownGlobals.push(
306-
global.fetch,
307-
global.FormData,
308-
global.Request,
309-
global.Response,
310-
global.Headers,
311-
);
307+
// TODO(@ethan-arrowood): Similar to previous checks, this can be temporary
308+
// until v16.x is EOL. Once all supported versions have structuredClone we
309+
// can add this to the list above instead.
310+
if (global.structuredClone) {
311+
knownGlobals.push(global.structuredClone);
312312
}
313313

314+
if (global.fetch) {
315+
knownGlobals.push(fetch);
316+
}
314317
if (hasCrypto && global.crypto) {
315318
knownGlobals.push(global.crypto);
316319
knownGlobals.push(global.Crypto);
@@ -320,6 +323,27 @@ if (hasCrypto && global.crypto) {
320323
if (global.CustomEvent) {
321324
knownGlobals.push(global.CustomEvent);
322325
}
326+
if (global.ReadableStream) {
327+
knownGlobals.push(
328+
global.ReadableStream,
329+
global.ReadableStreamDefaultReader,
330+
global.ReadableStreamBYOBReader,
331+
global.ReadableStreamBYOBRequest,
332+
global.ReadableByteStreamController,
333+
global.ReadableStreamDefaultController,
334+
global.TransformStream,
335+
global.TransformStreamDefaultController,
336+
global.WritableStream,
337+
global.WritableStreamDefaultWriter,
338+
global.WritableStreamDefaultController,
339+
global.ByteLengthQueuingStrategy,
340+
global.CountQueuingStrategy,
341+
global.TextEncoderStream,
342+
global.TextDecoderStream,
343+
global.CompressionStream,
344+
global.DecompressionStream,
345+
);
346+
}
323347

324348
function allowGlobals(...allowlist) {
325349
knownGlobals = knownGlobals.concat(allowlist);

0 commit comments

Comments
 (0)