nodejs/test/parallel/test-stream-readable-setEnc...

16 lines
330 B
JavaScript
Raw Normal View History

2022-08-16 11:12:47 +08:00
'use strict';
require('../common');
const assert = require('assert');
const { Readable } = require('stream');
{
const readable = new Readable({ encoding: 'hex' });
assert.strictEqual(readable._readableState.encoding, 'hex');
readable.setEncoding(null);
assert.strictEqual(readable._readableState.encoding, 'utf8');
}