mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
e9ba08e116
stream: fix web streams have no Symbol.toStringTag stream: add unit tests PR-URL: https://github.com/nodejs/node/pull/45117 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
19 lines
859 B
JavaScript
19 lines
859 B
JavaScript
'use strict';
|
|
|
|
require('../common');
|
|
|
|
const assert = require('assert');
|
|
|
|
const classesToBeTested = [ WritableStream, WritableStreamDefaultWriter, WritableStreamDefaultController,
|
|
ReadableStream, ReadableStreamBYOBRequest, ReadableStreamDefaultReader,
|
|
ReadableStreamBYOBReader, ReadableStreamDefaultController, ReadableByteStreamController,
|
|
ByteLengthQueuingStrategy, CountQueuingStrategy, TransformStream,
|
|
TransformStreamDefaultController];
|
|
|
|
|
|
classesToBeTested.forEach((cls) => {
|
|
assert.strictEqual(cls.prototype[Symbol.toStringTag], cls.name);
|
|
assert.deepStrictEqual(Object.getOwnPropertyDescriptor(cls.prototype, Symbol.toStringTag),
|
|
{ configurable: true, enumerable: false, value: cls.name, writable: false });
|
|
});
|