-
Notifications
You must be signed in to change notification settings - Fork 28.2k
/
test-webstream-string-tag.js
35 lines (25 loc) · 2.1 KB
/
test-webstream-string-tag.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
'use strict';
require('../common');
const assert = require('assert');
assert.strictEqual(WritableStream.prototype[Symbol.toStringTag], 'WritableStream');
assert.strictEqual(WritableStreamDefaultWriter.prototype[Symbol.toStringTag], 'WritableStreamDefaultWriter');
assert.strictEqual(WritableStreamDefaultController.prototype[Symbol.toStringTag], 'WritableStreamDefaultController');
assert.strictEqual(ReadableStream.prototype[Symbol.toStringTag], 'ReadableStream');
assert.strictEqual(ReadableStreamBYOBRequest.prototype[Symbol.toStringTag], 'ReadableStreamBYOBRequest');
assert.strictEqual(ReadableStreamDefaultReader.prototype[Symbol.toStringTag], 'ReadableStreamDefaultReader');
assert.strictEqual(ReadableStreamBYOBReader.prototype[Symbol.toStringTag], 'ReadableStreamBYOBReader');
assert.strictEqual(ReadableStreamDefaultController.prototype[Symbol.toStringTag], 'ReadableStreamDefaultController');
assert.strictEqual(ReadableByteStreamController.prototype[Symbol.toStringTag], 'ReadableByteStreamController');
assert.strictEqual(ByteLengthQueuingStrategy.prototype[Symbol.toStringTag], 'ByteLengthQueuingStrategy');
assert.strictEqual(CountQueuingStrategy.prototype[Symbol.toStringTag], 'CountQueuingStrategy');
assert.strictEqual(TransformStream.prototype[Symbol.toStringTag], 'TransformStream');
assert.strictEqual(TransformStreamDefaultController.prototype[Symbol.toStringTag], 'TransformStreamDefaultController');
const classesToBeTested = [ WritableStream, WritableStreamDefaultWriter, WritableStreamDefaultController,
ReadableStream, ReadableStreamBYOBRequest, ReadableStreamDefaultReader,
ReadableStreamBYOBReader, ReadableStreamDefaultController, ReadableByteStreamController,
ByteLengthQueuingStrategy, CountQueuingStrategy, TransformStream,
TransformStreamDefaultController];
classesToBeTested.forEach((cls) => {
assert.deepStrictEqual(Object.getOwnPropertyDescriptor(cls.prototype, Symbol.toStringTag),
{ configurable: true, enumerable: false, value: cls.name, writable: false });
});