diff --git a/changelog.md b/changelog.md index 0937dde..a61f36a 100644 --- a/changelog.md +++ b/changelog.md @@ -22,6 +22,7 @@ - Updated `actions/setup-node` to v3. - Reorganized the test file structure. - Use the `.js` file extension in `require` paths. +- Use the Node.js `Readable` property `readableEncoding` instead of `_readableState.encoding` in tests. - Fixed a typo in a code comment. ## 13.0.0 diff --git a/processRequest.test.mjs b/processRequest.test.mjs index adcd661..02ba1fa 100644 --- a/processRequest.test.mjs +++ b/processRequest.test.mjs @@ -67,7 +67,7 @@ export default (tests) => { const stream = upload.createReadStream(); ok(stream instanceof ReadStream); - strictEqual(stream._readableState.encoding, null); + strictEqual(stream.readableEncoding, null); strictEqual(stream.readableHighWaterMark, 16384); strictEqual(await streamToString(stream), "a"); } catch (error) { @@ -120,7 +120,7 @@ export default (tests) => { const stream = upload.createReadStream({ encoding, highWaterMark }); ok(stream instanceof ReadStream); - strictEqual(stream._readableState.encoding, encoding); + strictEqual(stream.readableEncoding, encoding); strictEqual(stream.readableHighWaterMark, highWaterMark); strictEqual( await streamToString(stream),