-
Notifications
You must be signed in to change notification settings - Fork 30k
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: #52283 Fixes: #52263 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Daeyeon Jeong <[email protected]> Reviewed-By: Chemi Atlow <[email protected]> Reviewed-By: Matthew Aitken <[email protected]> Reviewed-By: Filip Skokan <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Deokjin Kim <[email protected]> Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]>
- Loading branch information
1 parent
c0000f4
commit fa71543
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')); | ||
}); | ||
}); |