| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent c0000f4 commit fa71543
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -78,7 +78,7 @@ class CompressionStream { | |||
| 78 | 78 | } | |
| 79 | 79 | ||
| 80 | 80 | [kInspect](depth, options) { | |
| 81 | - customInspect(depth, options, 'CompressionStream', { | ||
| 81 | + return customInspect(depth, options, 'CompressionStream', { | ||
| 82 | 82 | readable: this.#transform.readable, | |
| 83 | 83 | writable: this.#transform.writable, | |
| 84 | 84 | }); | |
@@ -128,7 +128,7 @@ class DecompressionStream { | |||
| 128 | 128 | } | |
| 129 | 129 | ||
| 130 | 130 | [kInspect](depth, options) { | |
| 131 | - customInspect(depth, options, 'DecompressionStream', { | ||
| 131 | + return customInspect(depth, options, 'DecompressionStream', { | ||
| 132 | 132 | readable: this.#transform.readable, | |
| 133 | 133 | writable: this.#transform.writable, | |
| 134 | 134 | }); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,41 @@ | |||
| 1 | + // Flags: --no-warnings --expose-internals | ||
| 2 | + 'use strict'; | ||
| 3 | + | ||
| 4 | + require('../common'); | ||
| 5 | + | ||
| 6 | + const assert = require('node:assert'); | ||
| 7 | + const { describe, it } = require('node:test'); | ||
| 8 | + const { | ||
| 9 | + CompressionStream, | ||
| 10 | + DecompressionStream, | ||
| 11 | + } = require('node:stream/web'); | ||
| 12 | + | ||
| 13 | + const { | ||
| 14 | + customInspectSymbol: kInspect, | ||
| 15 | + } = require('internal/util'); | ||
| 16 | + | ||
| 17 | + describe('DecompressionStream kInspect method', () => { | ||
| 18 | + it('should return a predictable inspection string with DecompressionStream', () => { | ||
| 19 | + const decompressionStream = new DecompressionStream('deflate'); | ||
| 20 | + const depth = 1; | ||
| 21 | + const options = {}; | ||
| 22 | + const actual = decompressionStream[kInspect](depth, options); | ||
| 23 | + | ||
| 24 | + assert(actual.includes('DecompressionStream')); | ||
| 25 | + assert(actual.includes('ReadableStream')); | ||
| 26 | + assert(actual.includes('WritableStream')); | ||
| 27 | + }); | ||
| 28 | + }); | ||
| 29 | + | ||
| 30 | + describe('CompressionStream kInspect method', () => { | ||
| 31 | + it('should return a predictable inspection string with CompressionStream', () => { | ||
| 32 | + const compressionStream = new CompressionStream('deflate'); | ||
| 33 | + const depth = 1; | ||
| 34 | + const options = {}; | ||
| 35 | + const actual = compressionStream[kInspect](depth, options); | ||
| 36 | + | ||
| 37 | + assert(actual.includes('CompressionStream')); | ||
| 38 | + assert(actual.includes('ReadableStream')); | ||
| 39 | + assert(actual.includes('WritableStream')); | ||
| 40 | + }); | ||
| 41 | + }); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments