mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
test: enable more case of bad buffer in fs.write
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: https://github.com/nodejs/node/pull/46236 Refs: https://github.com/nodejs/node/pull/42796 Reviewed-By: LiviaMedeiros <livia@cirno.name> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
@@ -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, {});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user