Skip to content

Commit

Permalink
test: enable more case of bad buffer in fs.write
Browse files Browse the repository at this point in the history
Passing to the `string` parameter an object with an own
`toString` function is no longer supported.(DEP0162)
So use such case as bad buffer in test.

Refs: https://github.com/nodejs/node/blob/main/doc/api/deprecations.md#dep0162-fswrite-fswritefilesync-coercion-to-string
PR-URL: #46236
Refs: #42796
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
deokjinkim authored Jan 19, 2023
1 parent 009416d commit 49be0ac
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions test/parallel/test-fs-write-optional-params.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,7 @@ async function runTests(fd) {
new Date(),
new String('notPrimitive'),
{ [Symbol.toPrimitive]: (hint) => 'amObject' },

// TODO(LiviaMedeiros): add the following after DEP0162 EOL
// { toString() { return 'amObject'; } },
{ toString() { return 'amObject'; } },
]) {
await testInvalid(fd, 'ERR_INVALID_ARG_TYPE', badBuffer, {});
}
Expand Down

0 comments on commit 49be0ac

Please sign in to comment.