Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stream: validate writable defaultEncoding #46322

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
stream: test falsy defaultEncoding
  • Loading branch information
marco-ippolito committed Jan 24, 2023
commit f9a2d212e29ff4c94f6279a5f0ab5312bc3039f5
13 changes: 13 additions & 0 deletions test/parallel/test-stream-writable-decoded-encoding.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,16 @@ class MyWritable extends stream.Writable {
w.write('asd');
w.end();
}

{
const w = new MyWritable(function(isBuffer, type, enc) {
assert(!isBuffer);
assert.strictEqual(type, 'string');
assert.strictEqual(enc, 'utf8');
}, {
defaultEncoding: null,
decodeStrings: false
});
w.write('asd');
w.end();
}