From 49be0ac4ac1aa9be2c6f8f797934b90cb0e0f6e2 Mon Sep 17 00:00:00 2001 From: Deokjin Kim Date: Fri, 20 Jan 2023 00:39:45 +0900 Subject: [PATCH] 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 Reviewed-By: Luigi Pinca --- test/parallel/test-fs-write-optional-params.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/parallel/test-fs-write-optional-params.js b/test/parallel/test-fs-write-optional-params.js index 9a1e1cce738270..5072884b95c184 100644 --- a/test/parallel/test-fs-write-optional-params.js +++ b/test/parallel/test-fs-write-optional-params.js @@ -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, {}); }