diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2024-06-11 12:41:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-11 11:41:44 +0000 |
commit | 6a356aff1380e79d67738c5b43aa2b5fee76600d (patch) | |
tree | be4aadc62a523ff280820958a1a3829f1a18ca7d /tests/node_compat/test/parallel/test-fs-read-stream-inherit.js | |
parent | 3d41b486da7dcba49c8a18b45425e356c329d986 (diff) |
chore: sync up Node.js test files for v20.11.1 (#24066)
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
Diffstat (limited to 'tests/node_compat/test/parallel/test-fs-read-stream-inherit.js')
-rw-r--r-- | tests/node_compat/test/parallel/test-fs-read-stream-inherit.js | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/node_compat/test/parallel/test-fs-read-stream-inherit.js b/tests/node_compat/test/parallel/test-fs-read-stream-inherit.js index 79fa88486..2f8c139e8 100644 --- a/tests/node_compat/test/parallel/test-fs-read-stream-inherit.js +++ b/tests/node_compat/test/parallel/test-fs-read-stream-inherit.js @@ -57,7 +57,7 @@ const rangeFile = fixtures.path('x.txt'); } { - const file = fs.createReadStream(fn, Object.create({ encoding: 'utf8' })); + const file = fs.createReadStream(fn, { __proto__: { encoding: 'utf8' } }); file.length = 0; file.on('data', function(data) { assert.strictEqual(typeof data, 'string'); @@ -75,7 +75,7 @@ const rangeFile = fixtures.path('x.txt'); } { - const options = Object.create({ bufferSize: 1, start: 1, end: 2 }); + const options = { __proto__: { bufferSize: 1, start: 1, end: 2 } }; const file = fs.createReadStream(rangeFile, options); assert.strictEqual(file.start, 1); assert.strictEqual(file.end, 2); @@ -89,7 +89,7 @@ const rangeFile = fixtures.path('x.txt'); } { - const options = Object.create({ bufferSize: 1, start: 1 }); + const options = { __proto__: { bufferSize: 1, start: 1 } }; const file = fs.createReadStream(rangeFile, options); assert.strictEqual(file.start, 1); file.data = ''; @@ -103,7 +103,7 @@ const rangeFile = fixtures.path('x.txt'); // https://github.com/joyent/node/issues/2320 { - const options = Object.create({ bufferSize: 1.23, start: 1 }); + const options = { __proto__: { bufferSize: 1.23, start: 1 } }; const file = fs.createReadStream(rangeFile, options); assert.strictEqual(file.start, 1); file.data = ''; @@ -122,7 +122,7 @@ const rangeFile = fixtures.path('x.txt'); assert.throws( () => { - fs.createReadStream(rangeFile, Object.create({ start: 10, end: 2 })); + fs.createReadStream(rangeFile, { __proto__: { start: 10, end: 2 } }); }, { code: 'ERR_OUT_OF_RANGE', @@ -132,7 +132,7 @@ const rangeFile = fixtures.path('x.txt'); } { - const options = Object.create({ start: 0, end: 0 }); + const options = { __proto__: { start: 0, end: 0 } }; const stream = fs.createReadStream(rangeFile, options); assert.strictEqual(stream.start, 0); assert.strictEqual(stream.end, 0); @@ -157,7 +157,7 @@ const rangeFile = fixtures.path('x.txt'); { let data = ''; let file = - fs.createReadStream(rangeFile, Object.create({ autoClose: false })); + fs.createReadStream(rangeFile, { __proto__: { autoClose: false } }); assert.strictEqual(file.autoClose, false); file.on('data', (chunk) => { data += chunk; }); file.on('end', common.mustCall(function() { @@ -171,7 +171,7 @@ const rangeFile = fixtures.path('x.txt'); function fileNext() { // This will tell us if the fd is usable again or not. - file = fs.createReadStream(null, Object.create({ fd: file.fd, start: 0 })); + file = fs.createReadStream(null, { __proto__: { fd: file.fd, start: 0 } }); file.data = ''; file.on('data', function(data) { file.data += data; @@ -188,7 +188,7 @@ const rangeFile = fixtures.path('x.txt'); // Just to make sure autoClose won't close the stream because of error. { - const options = Object.create({ fd: 13337, autoClose: false }); + const options = { __proto__: { fd: 13337, autoClose: false } }; const file = fs.createReadStream(null, options); file.on('data', common.mustNotCall()); file.on('error', common.mustCall()); |