test: add known issue tests for fs.cp

PR-URL: https://github.com/nodejs/node/pull/58883
Refs: https://github.com/nodejs/node/issues/58634
Refs: https://github.com/nodejs/node/issues/58869
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Jason Zhang <xzha4350@gmail.com>
Reviewed-By: Dario Piotrowicz <dario.piotrowicz@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
James M Snell 2025-06-30 21:35:06 -07:00 committed by GitHub
parent f69f90d97a
commit 2022f832a9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 111 additions and 0 deletions

View file

@ -0,0 +1,23 @@
'use strict';
// We expect this test to fail because the implementation of fsPromise.cp
// does not properly support the use of Buffer as the source or destination
// argument like fs.cpSync does.
// Refs: https://github.com/nodejs/node/issues/58634
// Refs: https://github.com/nodejs/node/issues/58869
const common = require('../common');
const { mkdirSync, promises } = require('fs');
const { join } = require('path');
const tmpdir = require('../common/tmpdir');
tmpdir.refresh();
const tmpA = join(tmpdir.path, 'a');
const tmpB = join(tmpdir.path, 'b');
mkdirSync(tmpA, { recursive: true });
promises.cp(Buffer.from(tmpA), Buffer.from(tmpB), {
recursive: true,
}).then(common.mustCall());