forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stream: fix util.inspect for compression/decompressionStream
PR-URL: nodejs#52283 Fixes: nodejs#52263 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Matthew Aitken <maitken033380023@gmail.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Deokjin Kim <deokjin81.kim@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
- Loading branch information
1 parent
4caad41
commit f797156
Showing
2 changed files
with
43 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Flags: --no-warnings --expose-internals | ||
'use strict'; | ||
|
||
require('../common'); | ||
|
||
const assert = require('node:assert'); | ||
const { describe, it } = require('node:test'); | ||
const { | ||
CompressionStream, | ||
DecompressionStream, | ||
} = require('node:stream/web'); | ||
|
||
const { | ||
customInspectSymbol: kInspect, | ||
} = require('internal/util'); | ||
|
||
describe('DecompressionStream kInspect method', () => { | ||
it('should return a predictable inspection string with DecompressionStream', () => { | ||
const decompressionStream = new DecompressionStream('deflate'); | ||
const depth = 1; | ||
const options = {}; | ||
const actual = decompressionStream[kInspect](depth, options); | ||
|
||
assert(actual.includes('DecompressionStream')); | ||
assert(actual.includes('ReadableStream')); | ||
assert(actual.includes('WritableStream')); | ||
}); | ||
}); | ||
|
||
describe('CompressionStream kInspect method', () => { | ||
it('should return a predictable inspection string with CompressionStream', () => { | ||
const compressionStream = new CompressionStream('deflate'); | ||
const depth = 1; | ||
const options = {}; | ||
const actual = compressionStream[kInspect](depth, options); | ||
|
||
assert(actual.includes('CompressionStream')); | ||
assert(actual.includes('ReadableStream')); | ||
assert(actual.includes('WritableStream')); | ||
}); | ||
}); |